Link Search Menu Expand Document

Create

/api/v2/story/create

Post

stories

profiles

jwt


Purpose

To allow a user to post a story.

Body Content [input]

{
    uid: string,
    content: string,
    visibility: string
}

Returns if valid [output]

{
    storyID: string,
    error: 0
}

What the API does

  • Validates the value of the visibility field passed to make sure that its value is either public, followers, none or one among the accessIDs found in the access_groups field in the record corresponding to that of the uid passed from the profiles collection [400].
  • Generates a unique storyID and a timestamp for the current date/time.
  • Saves the document in the stories collection using the uid, content, and visibility fields passed, as well as the generated timestamp for the posted_on field, and uses the generated storyID. Empty / Default values will be used for the views field.