Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/robot/privateChatMessages/batchRecall |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-qyapi_robot_sendmsg-Permission for bots to send messages within your organization |
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 enterprise that has authorized a third-party app API. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| openConversationId | String | Yes | The chat ID. The value must be the same as the openConversationId used in the Send a plain message in a one-to-one chat through a bot API or the Create and deliver a card API. |
| robotCode | String | Yes | The bot code. For more information, see Bot ID. The value must be the same as the robotCode used in the Send a plain message in a one-to-one chat through a bot API. |
| processQueryKeys | Array of String | Yes | The message IDs. - For an internal app, obtain the processQueryKey parameter value by calling the Create and deliver a card API or the Send a plain message in a one-to-one chat through a bot API. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| successResult | Array of String | The IDs of the messages that were successfully recalled. |
| failedResult | Map<String, String> | The IDs of the messages that failed to be recalled, along with the reasons for failure. |
Response body example
Error codes
If an error is returned when you call this API, refer to the Global error codes document to find a solution based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalid.openConversationId | %s | Invalid openConversationId. Check whether the openConversationId is correct. |
| 400 | invalidParameter.robotCode | %s | Invalid robotCode. Check whether the bot is in the chat. |
| 400 | invalidParameter.processQueryKeys.overMax | %s | The number of processQueryKeys exceeds the upper limit of 20. Split processQueryKeys into multiple arrays, each containing no more than 20 items, and call this API in batches. |
| 400 | not.allowed.robotCode | %s | Unauthorized robotCode. |
| 400 | invalidParameter.param.invalid | %s | Invalid parameter. Check whether the parameter is empty. |
| 400 | invalidParameter.robotCode.notExsit | %s | The bot does not exist. Check whether the bot corresponding to the robotCode is installed in the chat. |
| 400 | miss.chatbotId | %s | robotCode is missing. |
| 400 | invalidParameter.processQueryKey.missing | %s | processQueryKey is missing. |
| 400 | invalid.processQueryKey | %s | Invalid processQueryKey. Check whether the processQueryKey is correct. |
| 400 | miss.openConversationId | %s | openConversationId is missing. |
| 400 | bot.stopped | %s | The group bot has been disabled. |
| 400 | template.not.existed | %s | The bot template does not exist. |
| 400 | template.stopped | %s | The bot template has been disabled. |
| 400 | unauthorized | %s | Unauthorized. The operation is not allowed. |
| 400 | resource.not.found | %s | The bot does not exist. |
| 500 | system.error | %s | Unknown system error. |