> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Query the List of Attendance Members

> Call this API to query, page by page, the employees who are attendance members of a specified attendance group based on the attendance group's group_key.

Call this API to query the employees who are attendance members of a specified attendance group based on the attendance group's groupKey. If departments are configured as attendance members, this API cannot return the department IDs.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/group/users/query](https://api.dingtalk.io/topapi/attendance/group/users/query) |
| HTTP Method | POST |
| Supported app types | appType-Internal app |
| Required permissions | permission-qyapi\_attendance\_group\_read-Attendance group query permission |

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | 4c9ebd2b1534xxxx | The App credential used to call this API. Obtain it by calling the [Get the access\_token of an Internal App](https://help.dingtalk.io/open/development/obtain-orgapp-token) API. |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| size | Number | No | 50 | The page size. |
| cursor | String | Yes | 10 | The last user ID of the previous batch. Pass null or an empty value to start the query from the beginning. |
| op\_userid | String | No | user01 | The user ID of the operator. |
| group\_key | String | Yes | CEDDFFxxxx | The attendance group ID.  **Note**  If your attendance group identifier is group\_id, call the [Convert groupId to groupKey](https://help.dingtalk.io/open/development/groupid-to-groupkey.md) API to convert group\_id to group\_key. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/users/query" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=d2ee6exxxx9266c' \
-d 'cursor=%5C%22%5C%22' \
-d 'group_key=0151Exxxx17E876' \
-d 'op_userid=123456' \
-d 'size=50'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/users/query");
OapiAttendanceGroupUsersQueryRequest req = new OapiAttendanceGroupUsersQueryRequest();
req.setSize(50L);
req.setCursor("10");
req.setOpUserid("user01");
req.setGroupKey("CEDDFFxxxx");
OapiAttendanceGroupUsersQueryResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiAttendanceGroupUsersQueryRequest("https://api.dingtalk.io/topapi/attendance/group/users/query")

req.size=50
req.cursor="\"\""
req.op_userid="123456"
req.group_key="0151E0xxxx17E876"
try:
  resp= req.getResponse(access_token)
  print(resp)
except Exception,e:
  print(e)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiAttendanceGroupUsersQueryRequest;
$req->setSize("50");
$req->setCursor("\"\"");
$req->setOpUserid("123456");
$req->setGroupKey("0151E02xxxx7E876");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/users/query");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/users/query");
OapiAttendanceGroupUsersQueryRequest req = new OapiAttendanceGroupUsersQueryRequest();
req.Size = 50L;
req.Cursor = "\"\"";
req.OpUserid = "123456";
req.GroupKey = "0151E0xxxxE876";
OapiAttendanceGroupUsersQueryResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| request\_id | String | ntxswpdprw5d | The request ID. |
| result | DingOpenResult | | The returned result. |
| result | Result | | The query result. |
| user\_list | String\[] | user01 | The list of users. |
| has\_more | String | false | Indicates whether more data is available.   - **true**: Yes - **false**: No |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| success | Boolean | true | Indicates whether the call succeeded.   - **true**: Success - **false**: Failed |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "result": {
    "errcode": 0,
    "errmsg":"ok",
    "result": {
      "has_more": "false",
      "user_list": [
        "user01"
      ]
    },
    "success": true
  },
  "request_id": "ntxswpdprw5d"
}
```

### Error Codes

If a call to this API returns an error, use the error message to find a solution in the [Global Error Codes](https://help.dingtalk.io/open/development/server-api-error-codes-1.md) document.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.