Add to allowed senders list
Add one or more participants to the allowed senders list of a specific open channel.
- Users on the allowed senders list can send messages via the client SDK even when the open channel is frozen.
- The allowed sender status persists if the user leaves and rejoins (including when removed due to a ban). It is cleared when the open channel is destroyed and recreated.
Interaction with other mute features:
- Individual mute does not override the allowed senders list. A user who is individually muted but also on the allowed senders list can still send messages.
- Global mute overrides the allowed senders list. If a user is globally muted across all open channels, the allowed senders list does not take effect.
tip
Messages sent via the Platform Chat API are not affected by the freeze. Users can always send messages through the server API.
Request
POST: https://[Base URL](/platform-chat-api/base-url)/v4/open-channel/participant/allowed-sender-list/add
Rate limit: 100 per second
Signature: Required. See API request signature.
Request body
Content type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
channelId | String | Yes | The open channel ID. |
participantIds | Array | Yes | User IDs to add. Maximum 20 per request. The allowed senders list supports up to 20 users per open channel. |
extra | String | No | JSON-formatted extra data for the notification. Only effective when needNotify is true. |
needNotify | Boolean | No | Whether to notify participants. Default: false. When true, notifies all participants (requires Android/iOS IMLib >= 5.4.5; Web IMLib >= 5.7.9). |
Request example
HTTP
POST /v4/open-channel/participant/allowed-sender-list/add HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json
{
"channelId": "LoDld8izA",
"participantIds": ["uu1", "uu2"]
}
Response
| Field | Type | Description |
|---|---|---|
code | Number | Return code. 0 indicates success. |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"code":0}