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
profilefor both that corresponding touidand that corresponding toprofileID, and ensures that neither is a value among the values of theblockedfield of the other [403]. - Generates a unique
notificationIDand atimestampcorresponding to the current date and time. - Creates and saves a new object inside of the
notificationscollection with the value ofprofileIDcorresponding to that of theuidfield, the value ofuidcorresponding to that of theprofileIDfield, uses the passedcontent,typeandredirectas well as the value of the generatednotificationIDand the value of the generatedtimestampfield for thecreated_onfield.