SendBroadcastMessage
https://rtc-api.zego.im/
Call this interface to send broadcast messages in a room, i.e., send text messages to all users in the same room.
Clients receive messages using ZEGO Express SDK callback interfaces:
| ZegoExpress SDK | LiveRoom SDK | |
|---|---|---|
| iOS/macOS | onIMRecvBroadcastMessage | onRecvRoomMessage |
| Android | onIMRecvBroadcastMessage | onRecvRoomMessage |
| Windows | onIMRecvBroadcastMessage | OnRecvRoomMessage |
| Web | IMRecvBroadcastMessage | onRecvRoomMsg |
- When sending a message from the server using a specific User ID, the client using the same User ID will not receive that message, meaning the sender cannot receive the message they sent.
- If developers need all users in the room to receive the message, when calling this interface, a User ID other than those in the room should be used.
- The User ID used does not need to log in to the room to send messages directly.
Request
Query Parameters
Possible values: [SendBroadcastMessage]
Interface prototype parameter
https://rtc-api.zego.im?Action=SendBroadcastMessage
💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.
💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.
💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.
💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.
Possible values: [2.0]
Default value: 2.0
💡Public parameter. Signature version number.
Room ID.
Sender User ID.
Sender username (corresponds one-to-one with UserId).
Possible values: [1, 2]
Message category. 1: System message. 2: Chat message.
Possible values: <= 1024 characters
Message content, length cannot exceed 1024 bytes. When using, URL encoding (UrlEncode) must be performed on the content.
Responses
- 200
- application/json
