logo
In-app Chat
ZIMAudio
On this page

RevokePeerMessage

POST

https://zim-api.zego.im/

By calling this API, you can recall one-to-one conversation messages within 2 minutes. If you need to recall messages sent earlier, please contact ZEGOCLOUD Technical Support. Messages sent within 24 hours can be recalled at most.

After a message is recalled, the message receiving user will receive a notification that the message has been recalled through the following ZIM SDK callback interfaces.

iOSAndroidmacOSWindows
messageRevokeReceivedonMessageRevokeReceivedmessageRevokeReceivedonMessageRevokeReceived
WebMini ProgramFlutterReact Native
messageRevokeReceivedmessageRevokeReceivedonMessageRevokeReceivedmessageRevokeReceived
Unity3Duni-app | uni-app xHarmonyOS
OnMessageRevokeReceivedmessageRevokeReceivedmessageRevokeReceived
Note
The users corresponding to the parameters FromUserId and ToUserId have logged in to the ZIM service by calling the login method on the client, or the developer has registered the relevant userID by calling the server-side API.
QPS Limit
20 times/s

Request

Query Parameters

    Action stringrequired

    Possible values: [RevokePeerMessage]

    API prototype parameter

    https://zim-api.zego.im/?Action=RevokePeerMessage

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.

    Timestamp int64required

    💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    Signature stringrequired

    💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.

Body

required
    FromUserId stringrequired

    Possible values: <= 32 characters

    User ID of the message sender.

    ToUserId stringrequired

    Possible values: <= 32 characters

    User ID of the message receiver.

    MsgSeq numberrequired

    Message seq. How to obtain:

    • To recall a one-to-one message sent by the client, obtain MsgSeq through the message sent callback.
    • To recall a one-to-one message sent by the server-side API SendPeerMessage, obtain MsgSeq through the API response data.
    Payload string

    Possible values: <= 200 characters

    Additional information attached to the recall operation, maximum 200 bytes.

    OfflinePush object

    Offline push configuration. If configured and enabled, the message recall will be notified in the form of offline push when the device switches to the background. For details, please refer to OfflinePush description.

Responses

OK
Schema
    Code number

    Return code.

    The following only lists the return codes related to the API business logic. For the complete return codes, please refer to Return codes.

    Return codeDescriptionSuggested Solution
    660000002Parameter error.Please refer to Request and enter the correct parameters.
    660000022Message not found, possibly because the message has been deleted or does not exist.Please check if the message has been deleted and if MsgSeq is correct.
    660000023Message has been recalled.Please confirm if the message has been recalled.
    • If confirmed that the message has been recalled, no action is needed.
    • If confirmed that the message has not been recalled, please contact ZEGOCLOUD Technical Support to troubleshoot the issue.
    660000024Recall time has been exceeded.If you need to recall messages sent over a longer period, please contact ZEGOCLOUD Technical Support for configuration.
    660000026The message to be recalled does not match FromUserId.Please check if the FromUserId field is correct.
    660300005The API call frequency exceeds the AppID-level limit.Please try again later, or refer to the relevant documentation to understand the call frequency.
    Message string

    Description of the request result.

    RequestId string

    Request ID.

Previous

Send a room message

Next

Recall a group message

On this page

Back to top