Skip to main content

Callback for Single Chat Message Revocation

Function Description

The App business server can use this callback to receive requests for users retracting single chat messages.

Precautions

  • To enable the callback, it is necessary to configure the callback URL and activate the corresponding switch for this callback protocol. Configuration methods can be found in the Callback Explanation document.
  • The direction of the callback is an HTTP/HTTPS POST request initiated by OpenIM Server to the App backend.
  • After receiving the callback request, the App business server must verify whether the command parameter in the request URL is its SDKNAME parameter.
  • The APP business server must respond to this request within the timeout period.

Scenarios That May Trigger This Callback

  • App users retract single chat messages through the client.
  • App administrators retract single chat messages through the REST API admin_msgwithdraw interface.

Timing of the Callback

  • After the single chat message is successfully retracted.

Interface Description

Request URL Example

In the following example, the callback URL configured by the App is https://callbackurl.

https://callbackurl?command=$CallbackCommand&contenttype=json

Request Parameter Description

ParameterDescription
httpsRequest protocol is HTTPS, method is POST
https://callbackurlCallback URL
CallbackCommandFixed value: callbackSingleMsgRevokeCommand
contenttypeFixed value: JSON
Header NameExample ValueMandatoryTypeDescription
operationID1646445464564RequiredstringoperationID for global link tracing

Request Packet Example

{
"callbackCommand": "callbackSingleMsgRevokeCommand",
"sendID": "user123",
"receiveID": "user456",
"content": "Hello, how are you?"
}

Request Packet Field Explanation

FieldTypeDescription
callbackCommandstringCallback command, here for single chat message revocation callback
sendIDstringUser ID of the message sender
receiveIDstringUser ID of the message receiver
contentstringContent of the retracted message

Response Packet Example

Successful Response

{
"actionCode": 0,
"errCode": 0,
"errMsg": "Success",
"errDlt": "",
"nextCode": ""
}

Response Packet Field Explanation

FieldValueDescription
actionCode0Indicates if the business system's callback was executed correctly. 0 means the operation was successful.
errCode0Indicates a custom error code, here 0 means ignore the callback result.
errMsg"An error message"Simple error message corresponding to the custom error code.
errDlt"Detailed error information"Detailed error information corresponding to the custom error code.
nextCode1Next step instruction, 1 means to refuse to continue executing, set when actionCode is 0.