SendMessageToAllUsers
https://zim-api.zego.im/
Push message to all users refers to sending messages with specific content, such as text, images, etc., to all online users (including the message sender themselves) and offline users. This feature is suitable for scenarios such as announcements for all users, cross-room gift floating screens, etc.
- Online users: Users who have logged in to ZIM and whose heartbeat has not timed out.
- Offline users: Users whose heartbeat has timed out after logging in to ZIM and reporting ZPNsPushId.
- To use this feature, please activate ZIM Professional or Flagship service.
- Messages sent through this API will not create conversations and will not be saved.
Message receiving users can only receive broadcast messages through the following ZIM SDK callback interfaces and know which user sent the message.
| iOS | Android | macOS | Windows |
|---|---|---|---|
| broadcastMessageReceived | onBroadcastMessageReceived | broadcastMessageReceived | onBroadcastMessageReceived |
| Web | Mini Program | Flutter | React Native |
|---|---|---|---|
| broadcastMessageReceived | broadcastMessageReceived | onBroadcastMessageReceived | broadcastMessageReceived |
| uni-app | uni-app x | HarmonyOS |
|---|---|
| broadcastMessageReceived | broadcastMessageReceived |
The parameter FromUserId only supports numbers, English characters, and '!','#','$','%','&','(',')','+','-',':',';','<','=','.','>','?','@','[',']','^','_',' ','{','}','|','~'.
If the sender's SDK version (for version information, please refer to Release notes) is lower than 2.0.0, the ZIM server only supports Command type messages with MessageType of 2, and does not support other types.
To provide developers with a better experience, ZEGOCLOUD recommends that developers use the latest version of the SDK.
The message receiver's SDK version must be 2.10.0 or above to receive broadcast messages.
Request
Query Parameters
Possible values: [SendMessageToAllUsers]
API prototype parameter
https://zim-api.zego.im/?Action=SendMessageToAllUsers
💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.
💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.
💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.
Possible values: [2.0]
Default value: 2.0
💡Public parameter. Signature version number.
💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.
- application/json
Responses
- 200
- application/json
