Recall Broadcast to Users Message-bearing Notification
Recalling a specified message essentially involves sending a recall command message. Upon receiving the recall command message, the mobile client will delete the original target message and generate a notification message with objectName
as RC:RcNtf
. The chat UI can display this notification based on RC:RcNtf
.
The following message types sent via the following functionalities can be recalled:
- Send Broadcast to Users Message-bearing Notification:
/message/broadcast.json
- Send Push Notification by Tag:
/push.json
- Send Push Notification by Package Name:
/push.json
The recall command message is also stored in the message history. When the SDK retrieves historical messages, it will fetch both the recall command message and the original message that was recalled. The mobile SDK has already implemented the deletion logic internally, so developers do not need to handle it separately.
Request Method
POST: https://data center domain/message/broadcast/recall.json
Rate Limit: Up to 2 times per hour, and a maximum of 3 times per calendar day.
Signature Rule: All server API requests must be validated according to the signature rules. For details, refer to API Request Signature.
Body Parameters
The HTTP request body data format is application/x-www-form-urlencoded
, and it supports the following HTTP form parameters:
Parameter | Type | Required | Description |
---|---|---|---|
fromUserId | String | Yes | The user ID of the message sender. |
messageUID | String | Yes | The unique identifier of the message. Currently, this can only be obtained from the Message History Log, where the corresponding field is msgUID .
|
sentTime | Long | No | The message sending time. Currently, this can only be obtained from the Message History Log, where the corresponding field is dateTime .
|
isAdmin | Int | No | Whether the sender is an administrator. The default is 0. |
isDelete | Int | No | By default, when set to 0, the message is recalled, and the client replaces it with a gray bar recall notification. When set to 1, the message is deleted without being replaced by a gray bar notification. |
extra | String | No | Extended information, which can contain arbitrary data. |
disableUpdateLastMsg | Boolean | No | Prevent updating the last message in the conversation. When this parameter is false , the sent message will appear in the conversation list; when true , it will not update the message content in the conversation list.Note: This parameter only applies to messages stored on the client. |
Request Example
POST /message/recall.json HTTP/1.1
Host: api.rong-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded
fromUserId=fDR2cVpxxR5zSMUNh3yAwh&messageUID=5FGT-7VA9-G4DD-4V5P&sentTime=1507778882124
Response
The HTTP response body contains a JSON object with the following structure:
Return Value | Type | Description |
---|---|---|
code | Number | Return code, 200 indicates success. |
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"code":200}