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

# Batch Query Locations

> Call this API to query the location list of an attendance group in batches with pagination by attendance group ID.

Call this API to query the location list of a specified attendance group in batches.

## Request

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

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | 4c9ebd2b15xxxx | 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 |
| - | - | - | - | - |
| cursor | String | No | 0151Exxxx | Leave empty for the first request. For subsequent requests when has\_more is true, set cursor to the value of the last position\_key in the previous request result. |
| size | Number | Yes | 50 | The page size. |
| op\_userid | String | No | user01 | The user ID of the operator. |
| group\_key | String | Yes | CEDDFxxxx | 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/positions/query" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=80645xxxx3164b3' \
-d 'cursor=0151E02xxxx7E876' \
-d 'group_key=0151ExxxxA1A917E876' \
-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/positions/query");
OapiAttendanceGroupPositionsQueryRequest req = new OapiAttendanceGroupPositionsQueryRequest();
req.setCursor("0151Exxxx");
req.setSize(50L);
req.setOpUserid("user01");
req.setGroupKey("CEDDFxxxx");
OapiAttendanceGroupPositionsQueryResponse 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.OapiAttendanceGroupPositionsQueryRequest("https://api.dingtalk.io/topapi/attendance/group/positions/query")

req.cursor="0151E0xxxx917E876"
req.size=50
req.op_userid="123456"
req.group_key="0151E0xxxxA917E876"
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 OapiAttendanceGroupPositionsQueryRequest;
$req->setCursor("0151E0xxxx17E876");
$req->setSize("50");
$req->setOpUserid("123456");
$req->setGroupKey("0151E0xxxx917E876");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/positions/query");
```

C#

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

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | DingOpenResult | | The returned result. |
| result | Result | | The query result. |
| position\_list | Position\[] | | The position list. |
| offset | Number | 100 | The allowed offset for the clock-in location. |
| address | String | Alibaba Group Xixi Campus | The address description. |
| latitude | String | 30.123 | The latitude (up to 6 decimal places). |
| longitude | String | 120.123 | The longitude (up to 6 decimal places). |
| position\_key | String | 9E459Fxxxx | The unique identifier of the position. |
| has\_more | Boolean | false | Whether more data exists.   - **true**: Yes - **false**: No |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The return code description. |
| success | Boolean | true | Whether the request succeeded.   - **true**: Success - **false**: Failed |
| request\_id | String | rss38gia1egs | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "result": {
    "errcode": 0,
    "errmsg":"ok",
    "result": {
      "has_more": false,
      "position_list": [
        {
          "offset":100,
          "address": "Alibaba Group Xixi Campus",
          "latitude": "30.280232",
          "longitude": "120.171377",
          "position_key": "9E459Fxxxx"
        }            ]
    },
    "success": true
  },
  "request_id": "rss38gia1egs"
}
```

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