Link Search Menu Expand Document

Post

/api/v2/notification/post

Post

notifications

profiles

jwt

disabled


Purpose

To allow a user to create a notification for another user.

Body Content [input]

{
    uid: string,
    profileID: string,
    content: string,
    type: string,
    redirect: string
}

Returns if valid [output]

{
    message: string,
    error: 0
}

What the API does

  • Fetches the profile for both that corresponding to uid and that corresponding to profileID, and ensures that neither is a value among the values of the blocked field of the other [403].
  • Generates a unique notificationID and a timestamp corresponding to the current date and time.
  • Creates and saves a new object inside of the notifications collection with the value of profileID corresponding to that of the uid field, the value of uid corresponding to that of the profileID field, uses the passed content, type and redirect as well as the value of the generated notificationID and the value of the generated timestamp field for the created_on field.