Channel Developers

thumbnail

Get messages in a Group

Retrieve a list of messages in a Group by groupId

Accessible via URL https://api.channel.io/open/v5/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

Unix timestamp value of the first message to be retrieved

Query

limit

25

Optional

Restrict the maximum number of results - min : 1 - max : 500 - default : 25

Query

sortOrder

desc

Required

Order of messages (descending order means latest message first) - Available values : asc, desc, both - Default value : desc

Query

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

Retrieve a list of messages in a Group by groupName

Accessible via URL https://api.channel.io/open/v5/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

Unix timestamp value of the first message to be retrieved

Query

limit

25

Optional

Restrict the maximum number of results (range[1, 500]) Default value : 25

Query

sortOrder

desc

Required

Order of messages (descending order means latest message first) Available values : asc, desc, both Default value : desc

Query

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

Returns messages within a group along with related information.

JSON

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).