Link Search Menu Expand Document

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 the profiles collection corresponding to the value of the uid field passed [404].
  • Generates a unique collectionID.
  • Adds a new collection to the collections field of the found profile with the value of the generated collectionID, the value of the name field passed and uses an empty array for the value of the posts field.
  • Saves and sends back the generated collectionID.