Broadcast to all users
Broadcast a system channel message to all users in the app. The message is delivered via a polling mechanism — recipients receive it within 3 minutes.
- Supports built-in and custom message types.
- Can only be sent via the server API. Channel type is SYSTEM. Recipients cannot reply.
- Not stored in server-side history by default. See Broadcast service configuration to enable storage.
tip
Broadcast messages use a polling mechanism. Recipients receive the message within 3 minutes of sending.
Prerequisites
Enable the Broadcast Service for the current App Key. See Broadcast service configuration. Returns error 1009 if not enabled.
Request
POST: https://[Base URL](/platform-chat-api/base-url)/v4/system-channel/message/broadcast-all
Rate limit: 2 per hour, 3 per day (calendar day). Server processes up to 2000 messages per second.
Authentication: All server API requests require signature verification. See API request signing.
Request body
Content type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
fromUserId | String | Yes | Sender user ID. Must have obtained an access token. |
messageType | String | Yes | Message type. See Message type overview. Custom types must not start with RC: (max 32 characters). |
content | String | Yes | Message content, max 128 KB. Serialize built-in message content as a JSON string. |
pushContent | String | No | Push notification content for offline recipients. |
pushData | String | No | Custom data in the push payload. |
contentAvailable | Int | No | iOS silent push. 1: enable. 0 (default): disable. |
pushExt | String | No | Push configuration. See pushExt parameters. |
disableUpdateLastMsg | Boolean | No | Prevent updating the last message in the channel list. |
Request example
HTTP
POST /v4/system-channel/message/broadcast-all HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Timestamp: 1585127132438
Nonce: 14314
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json
{
"fromUserId": "2191",
"messageType": "RC:TxtMsg",
"content": "{\"content\":\"hello\",\"extra\":\"helloExtra\"}",
"pushContent": "thisisapush",
"pushData": "{\"pushData\":\"hello\"}"
}
Response
| Property | Type | Description |
|---|---|---|
code | Number | Status code. 0 indicates success. |
result | Object | Response data. |
result.messageUID | String | Broadcast message ID. |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code": 0,
"result": {
"messageUID": "XXXX-JJJJ-KKK-LLLL"
}
}