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
notificationscollection having the same value for theiruidfield as that passed and appends them to a list. - Loops through each of these
notificationsand adds a value to thesenderUsername,groupNameand/orroomNamefields after processing the value of thecontentfield.