Instant Messaging
Unsend a message
Update time: 2023/10/23 16:34:40
Unsends a message in chat rooms.
Overview
If app users unsend messages in a chat room, the message history stored in the cloud will also be deleted.
Upgrade the SDK to version 8.7.0 and later before you invoke this API to unsend messages in chat rooms.
Request URI
POST https://api.netease.im/nimserver/chatroom/recall.action HTTP/1.1
Content-Type:application/x-www-form-urlencoded;charset=utf-8
Request parameters
-
For information about how to set the header in a POST request, see API Call methods.
-
The settings of the body in a POST request:
Parameter | Type | Required | Description |
---|---|---|---|
roomid | Long | Yes | Chat room ID |
msgTimetag | Long | Yes | The timestamp when a message was unsent in milliseconds. |
msgId | String | Yes | unsent message ID |
fromAcc | String | Yes | User account unsending the message, accid |
operatorAcc | String | Yes | Operator account unsending the message, accid |
notifyExt | String | No | extension field for notifications, up to 1,024 characters long. |
Example
Example request (cURL)
curl -X POST -H "CheckSum: 51eb13ea**85c7866c366" -H "AppKey: f54166405***6ad7799&fromAcc=acc01&" -H "Nonce: 1" -H "CurTime: 1451207708" -H "Content-Type: application/x-www-form-urlencoded" -d 'roomid=123&msgId=c9e6c306573778829419&msgTimetag=1212121&operatorAcc=acc01&fromAcc=acc02' 'https://api.netease.im/nimserver/chatroom/recall.action'
Example success response
"Content-Type": "application/json; charset=utf-8"
{
"code":200
}
Example error response
"Content-Type": "application/json; charset=utf-8"
{
"code":414
"desc":"msgidclient is null" // msgId field empty
}
Status codes
The following status codes are related to responses of this API. For the complete error codes, see Status codes.
Code | Description | Recommendation |
---|---|---|
200 | Success | - |
414 | Parameter error | Check the format and restrictions of arguments based on the error message |
416 | Rate limit. Too many requests within a short period of time | Lower the number of requests |
500 | Internal Server Error | - |
Was this page helpful?
Yes
No