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 eitherpublic
,followers
,none
or one among theaccessID
s found in theaccess_groups
field in the record corresponding to that of theuid
passed from theprofiles
collection [400]. - Generates a unique
storyID
and atimestamp
for the current date/time. - Saves the document in the
stories
collection using theuid
,content
, andvisibility
fields passed, as well as the generatedtimestamp
for theposted_on
field, and uses the generatedstoryID
. Empty / Default values will be used for theviews
field.