Skip to main content

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

ParameterTypeRequiredDescription
fromUserIdStringYesSender user ID. Must have obtained an access token.
messageTypeStringYesMessage type. See Message type overview. Custom types must not start with RC: (max 32 characters).
contentStringYesMessage content, max 128 KB. Serialize built-in message content as a JSON string.
pushContentStringNoPush notification content for offline recipients.
pushDataStringNoCustom data in the push payload.
contentAvailableIntNoiOS silent push. 1: enable. 0 (default): disable.
pushExtStringNoPush configuration. See pushExt parameters.
disableUpdateLastMsgBooleanNoPrevent 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

PropertyTypeDescription
codeNumberStatus code. 0 indicates success.
resultObjectResponse data.
result.messageUIDStringBroadcast 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"
}
}