Fetch All
/api/v2/notification/fetch
Post
notifications
users
groups
rooms
jwt
pgn
Purpose
To allow a user to fetch all of his/her notifications.
Body Content [input]
{
uid: string
}
Returns if valid [output]
{
notifications: {
uid: string,
notificationID: string,
content: string,
profileID: string,
type: string,
created_on: Date,
read: bool,
redirect: string,
senderUsername: string,
groupName: string,
roomName: string
}[],
error: 0,
amount: int
}
What the API does
- Fetches all the records from the
notifications
collection having the same value for theiruid
field as that passed and appends them to a list. - Loops through each of these
notifications
and adds a value to thesenderUsername
,groupName
and/orroomName
fields after processing the value of thecontent
field.