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
visibilityfield passed to make sure that its value is eitherpublic,followers,noneor one among theaccessIDs found in theaccess_groupsfield in the record corresponding to that of theuidpassed from theprofilescollection [400]. - Generates a unique
storyIDand atimestampfor the current date/time. - Saves the document in the
storiescollection using theuid,content, andvisibilityfields passed, as well as the generatedtimestampfor theposted_onfield, and uses the generatedstoryID. Empty / Default values will be used for theviewsfield.