logo
In-app Chat
Powered Byspreading
On this page

Recall a room message


Note

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.

iOSAndroidmacOSWindows
messageRevokeReceivedonMessageRevokeReceivedmessageRevokeReceivedonMessageRevokeReceived
FlutterUnity3DReact NativeWeb
onMessageRevokeReceivedOnMessageRevokeReceivedmessageRevokeReceivedmessageRevokeReceived

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.

ParameterTypeRequiredDescription
FromUserIdStringYesThe ID of the message sender.
RoomIdStringYesThe room ID.
MsgSeqNumberYesThe sequence of the message. Method for obtaining MsgSeq
  • If a group message is sent from the client, obtain MsgSeq by using the Callback on message sent operation.
  • If a group message is sent by using the server API SendRoomMessage, obtain MsgSeq in the response data.
PayloadStringNoThe additional information of the recalling operation, which cannot exceed 200 bytes in length.

Sample request

  • Request URL:

    Untitled
    https://zim-api.zego.im/?Action=RevokeRoomMessage
    &<Common request parameters>
    
    1
    Copied!
  • Request body:

    Untitled
      {
          "FromUserId": "u1",
          "GroupId": "room1",
          "MsgSeq": 10,
          "Payload": "hello world"
      }
    
    1
    Copied!

Response parameters

ParameterTypeDescription
CodeNumberThe return code.
MessageStringThe description of the request result.
RequestIdStringThe request ID.

Sample response

Untitled
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782"
}
1
Copied!

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 CodeDescriptionSolution
660000001A common service error occurred.Try again, or contact ZEGOCLOUD technical support.
660000002Invalid parameter.Check the input parameter. For more information, see Request parameters.
660000022The 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.
660000023The message has been recalled.Check whether the message has been recalled.
  • If so, no handling is required.
  • If not, contact ZEGOCLOUD technical support.
660000027The configuration for save room messages is not enabled, so message recalling is not possible.Please subscribe to the ZIM enterprise plan.
660300001The room does not exist.Check whether the value of the RoomId parameter is valid.
660300002The user is not in the room.Please check the user ID.
660300005The QPS limit specified in AppID is exceeded.Try again later, or check the QPS limit on related documentation.

Previous

Recall a group message

Next

Push message to all users