SendRoomMessage
https://zim-api.zego.im/
Send room messages and push them to all online users in the room.
The client will receive message notifications in the room through the ZIM SDK callback interface.
| iOS | Android | macOS | Windows |
|---|---|---|---|
| roomMessageReceived | onRoomMessageReceived | roomMessageReceived | onRoomMessageReceived |
| Web | Mini Program | Flutter | React Native |
|---|---|---|---|
| roomMessageReceived | roomMessageReceived | onRoomMessageReceived | roomMessageReceived |
| Unity3D | uni-app | uni-app x | HarmonyOS |
|---|---|---|
| onReceiveRoomMessage | roomMessageReceived | roomMessageReceived |
The parameters FromUserId and RoomId only support numbers, English characters, and '!','#','$','%','&','(',')','+','-',':',';','<','=','.','>','?','@','[',']','^','_',' ','{','}','|','~'.
For sending and receiving custom messages with MessageType 200, the SDK version of the sender's and receiver's corresponding clients needs to be 2.8.0 or above.
If the receiver's SDK version is in the [2.0.0, 2.8.0) range, they can receive custom messages, but the message type will be displayed as unknown and the message content cannot be obtained. To obtain this message, please upgrade the SDK to version 2.8.0 or above.
If the receiver's SDK version is 1.x.x, they will not be able to receive custom messages, nor will they receive unknown messages.
Request
Query Parameters
Possible values: [SendRoomMessage]
API prototype parameter
https://zim-api.zego.im/?Action=SendRoomMessage
💡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
