SendCustomCommand
https://rtc-api.zego.im/
Call this interface to send custom messages in a Room, i.e., sending signaling messages to specified single or multiple users in the same Room.
Client-side message reception uses ZEGOCLOUD Express SDK callback interfaces:
| Platform | ZegoExpress SDK | LiveRoom SDK |
|---|---|---|
| iOS/macOS | onIMRecvCustomCommand | onReceiveCustomCommand |
| Android | onIMRecvCustomCommand | onRecvCustomCommand |
| Windows | onIMRecvCustomCommand | OnRecvCustomCommand |
| Web | IMRecvCustomCommand | onRecvCustomCommand |
- When sending messages through a certain FromUserId on the server, clients using the same FromUserId will not receive this message, i.e., the sender cannot receive messages sent by themselves.
- If developers need all users in the Room to receive the message, when calling this interface, a FromUserId other than the Room users should be passed in.
- The FromUserId used does not need to log in to the Room to send messages directly.
Request
Query Parameters
Possible values: [SendCustomCommand]
API Prototype Parameters
https://rtc-api.zego.im?Action=SendCustomCommand
💡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.
Possible values: >= 1, <= 10
Custom message destination User ID, supporting up to 10 destination User IDs. If this parameter is not filled in, the custom message is broadcast to all users in the Room; if this parameter is filled in, the custom message is only pushed to the destination users. Example: ToUserId[]=user1&ToUserId[]=user2
Possible values: <= 1024 characters
Custom message content, length cannot exceed 1024 bytes. When using, URL encoding (UrlEncode) must be performed on its content.
Responses
- 200
- application/json
