Recall a room message
To use this feature, please subscribe to the ZIM enterprise plan and make sure your AppID is set to enable saving room messages.
Overview
You can call this API to recall a room message.
After a message is recalled, users in the room will receive the notification by the following ZIM SDK callbacks.
iOS | Android | macOS | Windows |
---|---|---|---|
messageRevokeReceived | onMessageRevokeReceived | messageRevokeReceived | onMessageRevokeReceived |
Flutter | Unity3D | React Native | Web |
onMessageRevokeReceived | OnMessageRevokeReceived | messageRevokeReceived | messageRevokeReceived |
Request method and endpoint
- Request method: POST
- Request endpoint:
https://zim-api.zego.im/?Action=RevokeRoomMessage
- Transmission protocol: HTTPS
- Rate limit: 20 requests/second
Request parameters
The following table describes only the operation-specific request parameters and some common request parameters. For the complete list of common request parameters, see the Public request parameters section of the Accessing Server APIs topic.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId | String | Yes | The ID of the message sender. |
RoomId | String | Yes | The room ID. |
MsgSeq | Number | Yes | The sequence of the message. Method for obtaining MsgSeq :
|
Payload | String | No | The additional information of the recalling operation, which cannot exceed 200 bytes in length. |
Sample request
-
Request URL:
Untitledhttps://zim-api.zego.im/?Action=RevokeRoomMessage &<Common request parameters>
1 -
Request body:
Untitled{ "FromUserId": "u1", "GroupId": "room1", "MsgSeq": 10, "Payload": "hello world" }
1
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | The return code. |
Message | String | The description of the request result. |
RequestId | String | The request ID. |
Sample response
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782"
}
Return codes
The following table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.
Return Code | Description | Solution |
---|---|---|
660000001 | A common service error occurred. | Try again, or contact ZEGOCLOUD technical support. |
660000002 | Invalid parameter. | Check the input parameter. For more information, see Request parameters. |
660000022 | The message is not found, which may be that the message has been deleted or does not exist. | Check whether the message has been deleted and whether the value of the MsgSeq parameter is valid. |
660000023 | The message has been recalled. | Check whether the message has been recalled.
|
660000027 | The configuration for save room messages is not enabled, so message recalling is not possible. | Please subscribe to the ZIM enterprise plan. |
660300001 | The room does not exist. | Check whether the value of the RoomId parameter is valid. |
660300002 | The user is not in the room. | Please check the user ID. |
660300005 | The QPS limit specified in AppID is exceeded. | Try again later, or check the QPS limit on related documentation. |