Get messages in a Group

GET messages via groupId

Retrieve a list of messages in a Group by groupId

Parameter

Accessible via URL https://api.channel.io/open/v3/groups/{groupId}/messages and HTTP GET

📘

This method accepts application/json

Parameter

Example

Required

Description

Parameter Type

groupId

1234

Required

Id of Group

Path

since

1401231818

Optional

Epoch time in microseconds of the first message to be retrieved

Query

limit

25

Optional

Restrict the maximum number of messages to be retrieved

Query

sortOrder

desc

Required

Order messages should be listed (descending order means latest message first)

Query

Example

GET https://api.channel.io/open/v3/groups/1234/messages?since=1401231818&limit=25&sortOrder=asc

GET messages via groupName

Retrieve a list of messages in a Group by groupName

Parameter

Accessible via URL https://api.channel.io/open/v3/groups/@{groupName}/messages and HTTP GET

📘

This method accepts application/json

Parameter

Example

Required

Description

Parameter Type

groupName

justGroup

Required

Name of Group

Path

since

1401231818

Optional

Epoch time in microseconds of the first message to be retrieved

Query

limit

25

Optional

Restrict the maximum number of messages to be retrieved

Query

sortOrder

desc

Required

Order messages should be listed (descending order means latest message first)

Query

Example

GET https://api.channel.io/open/v3/groups/@justGroup/messages?since=1401231818&limit=25&sortOrder=asc

Response

Response

Returns messages within a group along with related information.

{
    "messages": [
        {
            "id": "String",
            "channelId": "String",
            "chatType": "Group",
            "chatId": "String",
            "personType": "Manager",
            "personId": "String",
            "message": "String",
            "messageV2": "String",
            "language": "String",
            "file": {}, 
            "webPage": {}, 
            "log": {}, 
            "requestId": "String",
            "option": {},
            "createdAt": 1584599803960
        },
    ],
    "bots": [
        {
            "id": "String",
            "channelId": "String",
            "name": "String",
            "createdAt": 1584597945291,
            "color": "String",
            "avatarUrl": "String"
        }
    ],
  "users": [],
  "next": "String"
}

Implementation Notes

The number of messages retrieved in this endpoint is restricted by the limit query parameter, and is capped to values in the closed interval [1, 500].

Pagination is supported through the since query parameter along with the next value contained in the root object of the JSON response. Successive queries to this endpoint using the previous next value as the since parameter will ultimately retrieve all messages in the chat.

If the since parameter is left empty, the list retrieved will start with the first message (as specified by the order parameter).