Overview
Queries the global conversation list. This API is commonly used by server-side management tools to review a user's conversations and then query the message history for a selected conversation.
Request
Authentication: Add authentication headers to the request. See Authentication.
Method:
GET
Rate limit:
100 requests/second
Endpoint: https://API domain/apigateway/globalconvers/query
Content-Type:
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
| start | int | Yes | Starting timestamp for the query. Leave empty for the initial query, which begins at the current time in descending order. | |
| count | int | No | Number of records per page. Default: 100. | |
| order | int | No | Query order. 0: descending; 1: ascending. Default: 0. | |
| target_id | string | No | User or group ID used to filter conversations. Maximum length: 32 characters. | |
| channel_type | int | No | Conversation type used to filter results. 1: private chat; 2: group chat. | |
| exclude_user_id | array | No | User IDs to exclude. To provide multiple values, use ?exclude_user_id=userid1&exclude_user_id=userid2. Each user ID can contain up to 32 characters. |
Request Example
GET /apigateway/globalconvers/query?start=xxx&count=20&target_id=xxx HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json
Response Example
{
"code":0,
"msg":"sucess",
"data":{
"items":[
{
"id":"xxxx",
"channel_type":1,
"user_id":"userid1",
"target_id":"userid2",
"time":1713786448549
},
{
"id":"yyyy",
"channel_type":2,
"user_id":"userid1",
"target_id":"groupid1",
"time":1713786449549,
}
]
}
}