Skip to main content

Get channel attributes

Retrieve all attributes of a specific channel, including tag information, pin status, and do-not-disturb settings. Use this endpoint to get a comprehensive view of the channel's current state and configuration.

Request

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

Rate limit: 100 per second

Signature: Required. See API request signature.

Request body

Content type: application/json

ParameterTypeRequiredDescription
userIdStringYesThe user ID.
channelIdStringYesTarget ID. Depending on the channel type, this is the other user's ID (direct), group ID (group), or system target ID (system).
channelTypeNumberYesChannel type. Supported values: 1 (Direct channel), 3 (Group channel), 6 (System channel).

Request example

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

{
"userId": "testUserId",
"channelId": "group1",
"channelType": 3
}

Response

FieldTypeDescription
codeNumberReturn code. 0 indicates success.
resultObjectResult data.
result.channelIdStringTarget ID. Depending on the channel type, this is the other user's ID, group ID, or system target ID.
result.channelTypeNumberChannel type. 1 (Direct channel), 3 (Group channel), 6 (System channel).
result.pinObjectPin information. Not returned if pin has never been set.
result.pin.isPinnedBooleanWhether the channel is pinned.
result.pin.pinnedAtNumberTimestamp when the channel was pinned.
result.notificationObjectDo-not-disturb settings. Not returned if never configured.
result.notification.levelNumberNotification level. -1: All messages notify. 0: Not set (defaults to group or app-level setting). 1: Only @ messages notify. 2: Only @ specific users notify. 4: Only @ all members notify. 5: No notifications.
result.tagsObject[]Tag list. Not returned if no tags are set. A channel can belong to multiple tags.
result.tags[].tagIdStringTag ID. Unique identifier, max 10 characters.
result.tags[].tagNameStringTag display name, max 15 characters.

Response example

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

{
"code": 0,
"result": {
"channelId": "user1",
"channelType": 1,
"tags": [
{
"tagId": "tag3",
"tagName": ""
},
{
"tagId": "tag1",
"tagName": ""
},
{
"tagId": "tag2",
"tagName": ""
}
],
"pin": {
"isPinned": true,
"pinnedAt": 1756380709937
},
"notification": {
"level": 5
}
}
}