Skip to main content

List channels in a tag

Query all channels associated with a specified tag. The response includes the tag ID and each channel's target ID and channel type.

Request

POST: https://[Base URL](/platform-chat-api/base-url)/v4/channel/tag/list

Rate limit: 100 per second

Signature: Required. See API request signature.

Request body

Content type: application/json

ParameterTypeRequiredDescription
userIdStringYesThe user ID.
tagIdStringYesTag ID.

Request example

HTTP
POST /v4/channel/tag/list HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json

{
"userId": "testUserId",
"tagId": "tag1"
}

Response

FieldTypeDescription
codeNumberReturn code. 0 indicates success.
resultObjectResult data.
result.tagIdStringTag ID.
result.channelsObject[]Channel list.
result.channels[].channelIdStringTarget ID. Depending on the channel type, this is the other user's ID, group ID, or system target ID.
result.channels[].channelTypeNumberChannel type. 1 (Direct channel), 3 (Group channel), 6 (System channel).

Response example

HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"code": 0,
"result": {
"tagId": "tag1",
"channels": [
{
"channelId": "user1",
"channelType": 1
},
{
"channelId": "group1",
"channelType": 3
}
]
}
}