Link Search Menu Expand Document

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 their uid field as that passed and appends them to a list.
  • Loops through each of these notifications and adds a value to the senderUsername, groupName and/or roomName fields after processing the value of the content field.