Link Search Menu Expand Document

Delete

/api/v2/story/delete

Post

stories

jwt


Purpose

To allow a user to delete a story that he/she has posted.

Body Content [input]

{
    uid: string,
    storyID: string
}

Returns if valid [output]

{
    message: string,
    error: 0
}

What the API does

  • Finds the story records from the stories collection corresponding to the storyID passed.
  • Ensures that that story record has the same value for its uid field as that passed.
  • Checks that the current day / time minus the value of the posted_on field of that story record is less than 24 hours [403].
  • Deletes the record from the stories collection corresponding to the value of the storyID field passed.