robotCode and processQueryKeys via a POST request. This API applies to scenarios where an organization needs to recall notification messages sent in error within 24 hours.
Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/robot/otoMessages/batchRecall |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-qyapi_robot_sendmsg-Permission for Bots in your organization to send messages |
Request header
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it as follows: - For an internal app, call the Get the access token of an internal app API. - For a third-party enterprise app, call the Get the access token of an organization authorized to a third-party app API. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| robotCode | String | Yes | The code of the Bot. For details, see Bot ID. This must match the robotCode used when calling the Bot sends group chat messages API. |
| processQueryKeys | Array of String | Yes | The list of unique message identifiers. Obtain them via the Batch send Bot messages in one-on-one chats API. - Up to 20 entries per call. - You can recall a message via its processQueryKey within 24 hours after sending. Messages cannot be recalled after 24 hours. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| successResult | Array of String | The list of message-sending task IDs that were successfully recalled. Note When a message sent by a Bot is recalled, no notice appears in the chat. |
| failedResult | Map<String, String> | The list of message-sending task IDs that failed to be recalled, along with the corresponding failure reasons. |
Response body example
Error codes
If calling this API returns an error, find solutions in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidParameter.robotCode | %s | The Bot does not exist. Check whether the Bot corresponding to robotCode is installed in your organization. |
| 400 | invalidParameter.processQueryKeys.overMax | %s | The number of processQueryKeys exceeds the upper limit of 20. Split processQueryKeys into multiple arrays of no more than 20 entries each and call this API in batches. |
| 400 | not.allowed.robotCode | %s | The message to be recalled was not sent by the Bot corresponding to robotCode. You do not have permission to recall the message. Pass in the correct robotCode. |
| 400 | invalidParameter.param.invalid | %s | Invalid parameter. Check whether the parameter is empty. |
| 400 | invalidParameter.processQueryKey.missing | %s | processQueryKey is missing. |
| 400 | invalid.processQueryKey | %s | Invalid processQueryKey. Check whether processQueryKey is correct. |
| 400 | robot.processQueryKey.expired | %s | processQueryKey has expired. The message cannot be recalled. |
| 400 | notRevoke.all.messages | %s | Not all messages were recalled. |
| 500 | system.error | %s | Unknown system error. |