GET
/
groups
/
{guid}
/
messages
List Group Messages
curl --request GET \
  --url https://{appid}.api-{region}.cometchat.io/v3/groups/{guid}/messages \
  --header 'apikey: <api-key>'
{
  "data": [
    {
      "id": "1",
      "conversationId": "superhero3_user_superhero5",
      "sender": "superhero3",
      "receiverType": "user",
      "receiver": "superhero5",
      "category": "message",
      "type": "text",
      "data": {
        "text": "test     hello",
        "entities": {
          "sender": {
            "entity": {
              "uid": "superhero3",
              "name": "Spiderman",
              "role": "default",
              "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png",
              "status": "offline",
              "createdAt": 1638361550
            },
            "entityType": "user"
          },
          "receiver": {
            "entity": {
              "uid": "superhero5",
              "name": "Cyclops",
              "role": "default",
              "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png",
              "status": "offline",
              "createdAt": 1638361550,
              "conversationId": "superhero3_user_superhero5"
            },
            "entityType": "user"
          }
        },
        "metadata": {
          "key1": "val1"
        }
      },
      "sentAt": 1638423490,
      "updatedAt": 1638423490
    }
  ],
  "meta": {
    "current": {
      "limit": 100,
      "count": 1
    },
    "next": {
      "affix": "append",
      "sentAt": 1638423490,
      "id": "1"
    }
  }
}

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Headers

onBehalfOf
string

UID of the user on whose behalf the action is performed.

Path Parameters

guid
string
required

A GUID of a group.

Query Parameters

searchKey
string

searches for occurence of message.

hasAttachments
boolean

Fetches messages that include attachments.

attachmentTypes
enum<string>

Displays messages according to the type of attachment. Supported types include: image, video, audio, and file.

Available options:
image,
video,
audio,
file
hasMentions
boolean

Fetches messages that include mentions.

Fetches messages that include links.

mentionedUids
boolean

Fetches messages that include the mentioned comma-separated UIDs.

unread
boolean

displays all the unread messages of the user.

undelivered
boolean

displays all the messages those are undelivered.

count
boolean

displays the count of messages as per group/user

hideMessagesFromBlockedUsers
boolean

Hides the messages from blocked users in group.

hideReplies
boolean

Shows only messages skipping the replies in the message thread.

affix
enum<string>

Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).

Available options:
append,
prepend
id
string

Retrieves all those messages after the passed id.

category
string

Fetches messages that belongs to specific category.

categories
any[]

Fetches messages that contains multiple categories.

type
string

Fetches messages that belongs to a specific type.

types
any[]

Fetches messages with multiple types.

myMentionsOnly
boolean
default:false

Filters messages with mentions for the UID in onBehalfOf header.

hasReactions
boolean
default:false

Filters messages sent by a the uid given in sender query param and has reactions. If onBehalfOf header is also set then the messages from their common conversations will be filtered.

sender
string

Filters messages with sender. If onBehalfOf header is also set then the messages from their common conversations will be filtered.

mentionsWithBlockedInfo
boolean
default:false

For the mentioned users, provides blocked information with respect to the UID in onBehalfOf header.

mentionswithTagInfo
boolean
default:false

Provides user tags for the mentioned users.

limit
integer
default:10

The number of records to fetch. Minimum value: 1, Maximum value: 1000

fromTimestamp
integer

Fetches the messages from this timestamp.

toTimestamp
integer

Fetches the messages till this timestamp.

withTags
boolean

This will fetch messages along with the tags.

tags
string[]

This will fetch only those messages belonging to the mentioned tags.

Response

200 - application/json

Retreived Group Messages

The response is of type object.