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
profilefrom theprofilescollection corresponding to the value of theuidfield passed [404]. - Generates a unique
collectionID. - Adds a new
collectionto thecollectionsfield of the foundprofilewith the value of the generatedcollectionID, the value of thenamefield passed and uses an empty array for the value of thepostsfield. - Saves and sends back the generated
collectionID.