Create
/api/v2/collection/create
Post
profiles
jwt
Purpose
To allow a user to create a collection.
Body Content [input]
{
uid: string,
name: string
}
Returns if valid [output]
{
collectionID: string,
message: string,
error: 0
}
What the API does
- Finds a
profile
from theprofiles
collection corresponding to the value of theuid
field passed [404]. - Generates a unique
collectionID
. - Adds a new
collection
to thecollections
field of the foundprofile
with the value of the generatedcollectionID
, the value of thename
field passed and uses an empty array for the value of theposts
field. - Saves and sends back the generated
collectionID
.