logo
In-app Chat
Powered Byspreading
On this page

Recall a group message


Overview

You can call this operation to recall a group message sent within two minutes. To recall an earlier message, contact ZEGOCLOUD technical support. You can recall a message sent within 24 hours at maximum.

After a message is recalled, recipients receive the notification in the following ZIM SDK callbacks.

iOSAndroidmacOSWindows
messageRevokeReceivedonMessageRevokeReceivedmessageRevokeReceivedonMessageRevokeReceived
FlutterUnity3DReact NativeWeb
onMessageRevokeReceivedOnMessageRevokeReceivedmessageRevokeReceivedmessageRevokeReceived

Operation prototype

  • Request method: POST
  • Request URL: https://zim-api.zego.im/?Action=RevokeGroupMessage
  • Protocol: HTTPS
  • QPS limit: 20 calls per 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.
GroupIdStringYesThe group chat 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 SendGroupMessage, obtain MsgSeq in the response data.
PayloadStringNoThe additional information of the recalling operation, which cannot exceed 200 bytes in length.
OfflinePushObjectNoThe offline push configuration. For more information, see OfflinePush Description.

Sample request

  • Request URL:

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

    Untitled
      {
          "FromUserId": "u1",
          "GroupId": "group1",
          "MsgSeq": 10,
          "Payload": "payload",
          "OfflinePush" :{
              "Enable":1,
              "Title":"title",
              "Content":"content",
              "Payload":"payload"
          }
      }
    
    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
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.
660000024The message has been sent too long.If you need to recall a message sent a long time ago, contact ZEGOCLOUD technical support.
660000026The message to be recalled and FromUserId do not match.Check whether the value of the FromUserId parameter is valid.
660300005The QPS limit specified in AppID is exceeded.Try again later, or check the QPS limit on related documentation.
660600001The group chat does not exist.Check whether the value of the GroupId parameter is valid.

Previous

Recall a one-to-one message

Next

Recall a room message