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
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | String | Yes | The user ID. |
channelId | String | Yes | Target ID. Depending on the channel type, this is the other user's ID (direct), group ID (group), or system target ID (system). |
channelType | Number | Yes | Channel 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
| Field | Type | Description |
|---|---|---|
code | Number | Return code. 0 indicates success. |
result | Object | Result data. |
result.channelId | String | Target ID. Depending on the channel type, this is the other user's ID, group ID, or system target ID. |
result.channelType | Number | Channel type. 1 (Direct channel), 3 (Group channel), 6 (System channel). |
result.pin | Object | Pin information. Not returned if pin has never been set. |
result.pin.isPinned | Boolean | Whether the channel is pinned. |
result.pin.pinnedAt | Number | Timestamp when the channel was pinned. |
result.notification | Object | Do-not-disturb settings. Not returned if never configured. |
result.notification.level | Number | Notification 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.tags | Object[] | Tag list. Not returned if no tags are set. A channel can belong to multiple tags. |
result.tags[].tagId | String | Tag ID. Unique identifier, max 10 characters. |
result.tags[].tagName | String | Tag 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
}
}
}