> ## 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 Attendance Group Information by groupKey

> Call this API with a groupKey to query an attendance group's clock-in range, whether field clock-in is allowed, and whether it needs approval.

This API queries attendance group information by the attendance group groupKey, including the clock-in range, whether field clock-in is allowed, and whether field clock-in requires approval.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/group/get](https://api.dingtalk.io/topapi/attendance/group/get) |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Required permission | permission-qyapi\_attendance\_group\_read-Attendance group read 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 [Get the access\_token of an Internal App](https://help.dingtalk.io/open/development/obtain-orgapp-token). |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| op\_userid | String | No | user123 | The user ID of the operator. |
| group\_key | String | Yes | 02B1Exxxx | The attendance group groupKey.  **Note**  If your attendance group identifier is group\_id, call [Convert groupId to groupKey](https://help.dingtalk.io/open/development/groupid-to-groupkey.md) 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/get" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=9d319xxxx6e5f0' \
-d 'group_key=0151E0xxxx2A1A917' \
-d 'op_userid=123456'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/get");
OapiAttendanceGroupGetRequest req = new OapiAttendanceGroupGetRequest();
req.setOpUserid("123456");
req.setGroupKey("0151E022xxxxx1A917");
OapiAttendanceGroupGetResponse 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.OapiAttendanceGroupGetRequest("https://api.dingtalk.io/topapi/attendance/group/get")

req.op_userid="123456"
req.group_key="0151E02xxxxA1A917"
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 OapiAttendanceGroupGetRequest;
$req->setOpUserid("123456");
$req->setGroupKey("0151Exxxx1A917");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/get");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/get");
OapiAttendanceGroupGetRequest req = new OapiAttendanceGroupGetRequest();
req.OpUserid = "123456";
req.GroupKey = "0151E0xxxxA1A917";
OapiAttendanceGroupGetResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | Object | | The attendance group information result. |
| name | String | Test attendance group 1 | The attendance group name. |
| ext | String | | Extension field in JSON format. |
| location\_offset | Number | 100 | The clock-in range, in meters.  **Note**  This field is deprecated. Use the offset returned by [Batch Query Locations](https://help.dingtalk.io/open/development/batch-query-position-under-attendance-group.md) instead. |
| group\_key | String | 0151E0223B1EDDDF00DD6B7F72A1A917 | The attendance group groupKey. |
| enable\_face\_check | Boolean | false | Whether smile clock-in is enabled.   - **true**: On - **false** (default): Off |
| enable\_face\_beauty | Boolean | false | Whether the beauty filter is enabled.   - **true**: On - **false** (default): Off |
| enable\_camera\_check | Boolean | false | Whether photo clock-in is enabled.   - **true**: On - **false** (default): Off |
| enable\_outside\_check | Boolean | false | Whether field clock-in is allowed.   - **true**: Allowed - **false** (default): Not allowed |
| enable\_outside\_apply | Boolean | false | Whether field clock-in requires approval.   - **true**: Required - **false** (default): Not required |
| outside\_check\_approve\_mode | Number | 0 | The approval mode for field clock-in.   - **-1** (default): Off - **0**: Approve first, then clock in - **1**: Clock in first, then approve |
| enable\_outside\_remark | Boolean | false | Whether field clock-in requires a remark.   - **true**: Required - **false** (default): Not required |
| enable\_outside\_camera\_check | Boolean | false | Whether field clock-in requires a photo remark.   - **true**: Required - **false** (default): Not required |
| forbid\_hide\_outside\_address | Boolean | true | Whether employees are prohibited from hiding the detailed address.   - **true** (default): Prohibited - **false**: Not prohibited |
| enable\_outside\_update\_normal\_check | Boolean | false | Whether field clock-in records can update regular clock-in records.   - **true**: Allowed - **false** (default): Not allowed |
| enable\_trim\_distance | Boolean | false | Whether location distance fine-tuning is allowed.   - **true**: Allowed - **false** (default): Not allowed |
| trim\_distance | Number | 50 | The location fine-tuning range, in meters. |
| errmsg | String | ok | The returned error message. |
| success | Boolean | true | Whether the request succeeded.   - **true**: Success - **false**: Failed |
| errcode | Number | 0 | The error code. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "result":{
    "ext":"",
    "enable_camera_check":false,
    "enable_face_beauty":false,
    "outside_check_approve_mode":0,
    "forbid_hide_outside_address":true,
    "enable_face_check":false,
    "enable_outside_apply":false,
    "enable_outside_camera_check":false,
    "enable_outside_update_normal_check":false,
    "trim_distance":50,
    "enable_outside_check":false,
    "location_offset":100,
    "enable_outside_remark":false,
    "name":"Test attendance group 1",
    "group_key":"0151E0223B1EDDDF00DD6B7F72A1A917",
    "enable_trim_distance":false
  },
  "errcode":0,
  "success":true,
  "errmsg":"ok"
}
```

### Error Codes

If this API returns an error, find a 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.