/group/getMessages

To fetch messages related to group. Has 2 main requirements, and 2 optionals:

  1. groupId

  2. userId

  3. minRange (optional)

  4. maxRange (optional)

IMPORTANT: If mixRange and maxRange are not specified. All group messages are returned. This is not advised due to performance reasons.


// get the recent 10 messages.
const groupMessages = await backend.post('/group/getMessages', {
    groupId: '<GROUP ID>',
    minRange: 0,
    maxRange: 10,
    userId: '<USER ID',
}).then(res => res.data).catch(e => { });

Returns an array of messages for the group. Each message contains the messageId, groupId, senderUserId, text, and date of storage.

Last updated