> ## 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 Group Details

> Call this API to query the details of a single attendance group by attendance group ID, including the attendance group name, primary owner, and attendance type.

Call this API to get the details of an attendance group by attendance group ID, such as the attendance group name, the primary owner of the attendance group, and the attendance type.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/group/query](https://api.dingtalk.io/topapi/attendance/group/query) |
| HTTP Method | POST |
| Supported app types | appType-Internal app　appType-Third-party enterprise app |
| Required 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, call the [Get the access\_token of an Internal App](https://help.dingtalk.io/open/development/obtain-orgapp-token) API to obtain it. - For a Third-party enterprise app, call the Get the access\_token of a Third-party Enterprise API to obtain it. |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| op\_user\_id | String | Yes | user123 | The userId of the operator. |
| group\_id | Number | Yes | 685935028 | The attendance group ID. Call the [Batch Get Attendance Group Details](https://help.dingtalk.io/open/development/batch-obtain-attendance-group-details.md) API to obtain the group\_id value.  **Note**  If you have a 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 the group\_key to a group\_id. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/query" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=65671xxxx92ddf0' \
-d 'group_id=23456' \
-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/query");
OapiAttendanceGroupQueryRequest req = new OapiAttendanceGroupQueryRequest();
req.setOpUserId("dd_dd");
req.setGroupId(23456L);
OapiAttendanceGroupQueryResponse 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.OapiAttendanceGroupQueryRequest("https://api.dingtalk.io/topapi/attendance/group/query")

req.op_user_id="dd_dd"
req.group_id=23456
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 OapiAttendanceGroupQueryRequest;
$req->setOpUserId("dd_dd");
$req->setGroupId("23456");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/query");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/query");
OapiAttendanceGroupQueryRequest req = new OapiAttendanceGroupQueryRequest();
req.OpUserId = "dd_dd";
req.GroupId = 23456L;
OapiAttendanceGroupQueryResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | TopSimpleGroupVO | | The returned result. |
| name | String | Attendance | The attendance group name. |
| shift\_ids | Number\[] | \[677995086] | The shift IDs. |
| id | Number | 685935028 | The attendance group ID. |
| wifis | String\[] | \["test-inc"] | The Wi-Fi names. |
| address\_list | String\[] | \["Xixi Wetland"] | The attendance addresses. |
| work\_day\_list | Number\[] | \[0,1,2,3] | The workdays. |
| member\_count | Number | 39 | The number of users. |
| type | String | TURN | The attendance group type.   - **FIXED:** A fixed shift attendance group - **TURN:** A shift-based attendance group - **NONE:** A flexible working hours attendance group |
| url | String | [https://attend.dingtalk.io/xxxx](https://attend.dingtalk.io/xxxx) | The redirect link. |
| manager\_list | String | user456 | The attendance group Admins. |
| owner\_user\_id | String | user01 | The userId of the primary owner of the attendance group. |
| success | Boolean | true | Indicates whether the request succeeded.   - **true**: Success - **false**: Failed |
| errcode | Number | 0 | The return code. |
| request\_id | String | 72hycvnsyykp | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "result": {
    "address_list": [
      "Xixi Wetland"
    ],
    "id": 685935028,
    "manager_list": "[user456]",
    "member_count": 1,
    "name": "Attendance",
    "owner_user_id": "user01",
    "shift_ids": [
      677995086
    ],
    "type": "TURN",
    "url": "https://attend.dingtalk.io/xxxx",
    "wifis": [
      "test-inc"
    ],
    "work_day_list": [
      0,
      677995086,
      677995086,
      677995086,
      677995086,
      678215070,
      0
    ]
  },
  "success": true,
  "request_id": "lps4czm0g3qu"
}
```

### Error Codes

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


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