Skip to main content

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

ParameterData TypeRequiredDescription
startintYesStarting timestamp for the query. Leave empty for the initial query, which begins at the current time in descending order.
countintNoNumber of records per page. Default: 100.
orderintNoQuery order. 0: descending; 1: ascending. Default: 0.
target_idstringNoUser or group ID used to filter conversations. Maximum length: 32 characters.
channel_typeintNoConversation type used to filter results. 1: private chat; 2: group chat.
exclude_user_idarrayNoUser 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,
}
]
}
}