> ## 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.

# Get Attendance Members

> Call this API with an attendance group ID to get the department IDs and user IDs of attendance members in that group.

Call this API to get the attendance members of an attendance group by attendance group ID, including the department IDs and the userIds of attendance members.

## API Call Description

If a department is set as an attendance member, the API returns the department ID but not the list of users in that department.

For example, if the attendance members include the **Test Department** and the employee **John**, this API returns the following information:

* The ID of the Test Department, but not the list of employee userIds in the department
* John's userId

## Request

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

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | bE74xxxx | The app credential used to call this API.   - For an internal app, obtain it by calling the [Get the access\_token of an internal app](https://help.dingtalk.io/open/development/obtain-orgapp-token) API. - For a third-party enterprise app, obtain it by calling the Get the access\_token of a third-party organization API. |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| cursor | Number | No | 0 | The cursor value. Pass 0 for the first request. Default: 0. |
| op\_user\_id | String | Yes | user123 | The userId of the operator. |
| group\_id | Number | Yes | 98562 | The attendance group ID.  **Note**  If you use the legacy attendance group identifier group\_key, call the [Convert groupKey to groupId](https://help.dingtalk.io/open/development/convert-groupkey-to-groupid.md) API to convert group\_key to group\_id. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/member/list" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=51525xxxx4e1df6' \
-d 'cursor=9828' \
-d 'group_id=98562' \
-d 'op_user_id=dd_dd'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/member/list");
OapiAttendanceGroupMemberListRequest req = new OapiAttendanceGroupMemberListRequest();
req.setCursor(0L);
req.setOpUserId("user123");
req.setGroupId(98562L);
OapiAttendanceGroupMemberListResponse 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.OapiAttendanceGroupMemberListRequest("https://api.dingtalk.io/topapi/attendance/group/member/list")

req.cursor=9828
req.op_user_id="dd_dd"
req.group_id=98562
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 OapiAttendanceGroupMemberListRequest;
$req->setCursor("9828");
$req->setOpUserId("dd_dd");
$req->setGroupId("98562");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/member/list");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/member/list");
OapiAttendanceGroupMemberListRequest req = new OapiAttendanceGroupMemberListRequest();
req.Cursor = 9828L;
req.OpUserId = "dd_dd";
req.GroupId = 98562L;
OapiAttendanceGroupMemberListResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| request\_id | String | zpdxhqyepfon | The request ID. |
| errcode | Number | 0 | The return code. |
| success | Boolean | true | Indicates whether the call succeeded.   - **true**: Success - **false**: Failed |
| result | PageResult | | The query result list. |
| has\_more | Boolean | false | Indicates whether more data is available.   - **true**: Yes - **false**: No |
| cursor | Number | 752095318 | The cursor. |
| result | TopGroupMemberVo\[] | | The list of user userIds. |
| atc\_flag | String | 0 | Indicates whether attendance is required.   - **0**: Attendance required - **1**: Attendance-exempt member |
| type | String | 0 | The type.   - **0**: Employee - **1**: Department |
| member\_id | String | user123 | The member ID, which can be a userId or deptId. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "result": {
    "cursor": 794905780,
    "has_more": false,
    "result": [
      {
        "atc_flag": "0",
        "member_id": "10203029011219896",
        "type": "0"
      }
    ]
  },
  "success": true,
  "request_id": "4hwa7nhm07cs"
}
```

### Error Codes

If the API call returns an error, find a solution based on the error message 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.