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
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | String | Yes | The user ID. |
tagId | String | Yes | Tag 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
| Field | Type | Description |
|---|---|---|
code | Number | Return code. 0 indicates success. |
result | Object | Result data. |
result.tagId | String | Tag ID. |
result.channels | Object[] | Channel list. |
result.channels[].channelId | String | Target ID. Depending on the channel type, this is the other user's ID, group ID, or system target ID. |
result.channels[].channelType | Number | Channel 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
}
]
}
}