Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/robot/groupMessages/query |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-qyapi_robot_sendmsg-Permission for an internal bot 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 authorized enterprise for a third-party app API. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| openConversationId | String | No | The group ID. Obtain the openConversationId of a group chat through the client-side chooseChat JSAPI. This must be the same as the openConversationId used in the Send a group chat message with a bot API. |
| robotCode | String | No | The bot code. For more information, see Bot ID. This must be the same as the robotCode used in the Send a group chat message with a bot API. |
| processQueryKey | String | Yes | The unique identifier of the message. Obtain it from the processQueryKey field in the response of the Send a group chat message with a bot API. |
| maxResults | Long | No | The number of items per page for the paginated query. The maximum value is 200. |
| nextToken | String | No | The pagination cursor. Leave it empty to start the query from the first page. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| sendStatus | String | The message delivery status: - SUCCESS: delivered successfully. - RECALLED: recalled. - PROCESSING: in progress. |
| readUserIds | Array of String | The userIds of users who have read the message. |
| nextToken | String | The cursor for the next paginated query. |
| hasMore | Boolean | Indicates whether more users are available for querying the read status in the paginated query. |
Response body example
Error codes
If an error is returned when you call this API, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidParameter.param.invalid | Invalid parameter | Invalid parameter. Check whether the parameter is empty. |
| 400 | invalidParameter.robotCode.notExsit | The bot does not exist | The bot does not exist. Check whether the bot is in the group. |
| 400 | invalidParameter.robotCode.missing | robotCode is missing | robotCode is missing. |
| 400 | invalidParameter.processQueryKey.missing | processQueryKey is missing | processQueryKey is missing. |
| 400 | invalidParameter.cursor.invalid | Invalid nextToken | Invalid nextToken. Check whether nextToken is correct. |
| 400 | invalidParameter.pageSize.invalid | Invalid maxResults | maxResults exceeds the upper limit of 200. |
| 400 | invalidParameter.invalid | The bot corresponding to the token does not exist | The bot corresponding to the token does not exist. Check whether the bot is in the group. |
| 400 | invalidParameter.robotCode.invalid | Invalid robotCode | Invalid robotCode. |
| 400 | invalid.openConversationId | Invalid openConversationId | Invalid openConversationId. |
| 400 | openConversationId.notExisted | openConversationId and token cannot both be empty | openConversationId and token cannot both be empty. |
| 400 | invalid.processQueryKey | Invalid processQueryKey | Invalid processQueryKey. |
| 400 | bot.stopped | The group bot has been disabled | The group bot has been disabled. |
| 400 | template.not.existed | The bot template does not exist | The bot template does not exist. |
| 400 | template.stopped | The bot template has been disabled | The bot template has been disabled. |
| 400 | processQueryKey.expireTime | processQueryKey has not generated message query data yet or has expired | processQueryKey has not generated message query data yet or has expired. The message cannot be queried. |
| 400 | conversation.org.dismatch | The chat does not belong to the current organization | The chat does not belong to the current organization. |
| 400 | resource.not.found | %s | The bot does not exist. |
| 400 | unauthorized | %s | Unauthorized. |
| 400 | auth.error | %s | Insufficient permissions. The operation is not allowed. |
| 500 | system.error | Unknown system error | Unknown system error. |