> ## 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 Scheduling Summaries of Users

> Query scheduling summaries for multiple users over up to 7 days, returning shift names, shift version IDs, and attendance group IDs.

Call this API to query the scheduling summaries of users within a specified time range, including shift names, shift version IDs, and attendance group IDs.

## Request

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

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | 57cf92xxx | 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 |
| - | - | - | - | - |
| op\_user\_id | String | Yes | manager123 | The user ID of the operator. |
| userids | String | Yes | user123,user456 | The list of user IDs to query. Separate multiple user IDs with commas. Each query supports a maximum of 20 user IDs. |
| from\_date\_time | Number | Yes | 1564985177000 | The Unix timestamp of the start date, in milliseconds.  **Note**  The time range cannot exceed 7 days. |
| to\_date\_time | Number | Yes | 1564985177000 | The Unix timestamp of the end date, in milliseconds.  **Note**  The time range cannot exceed 7 days. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/schedule/shift/listbydays" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=ecff22xxxx1f8d5d' \
-d 'from_date_time=1564985177000' \
-d 'op_user_id=dd_dd' \
-d 'to_date_time=1564985177000' \
-d 'userids=dd_test%2Ctl2342'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/schedule/shift/listbydays");
OapiAttendanceScheduleShiftListbydaysRequest req = new OapiAttendanceScheduleShiftListbydaysRequest();
req.setOpUserId("manager123");
req.setUserids("user123,user456");
req.setFromDateTime(1564985177000L);
req.setToDateTime(1564985177000L);
OapiAttendanceScheduleShiftListbydaysResponse 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.OapiAttendanceScheduleShiftListbydaysRequest("https://api.dingtalk.io/topapi/attendance/schedule/shift/listbydays")

req.op_user_id="dd_dd"
req.userids="dd_test,tl2342"
req.from_date_time=1564985177000
req.to_date_time=1564985177000
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 OapiAttendanceScheduleShiftListbydaysRequest;
$req->setOpUserId("dd_dd");
$req->setUserids("dd_test,tl2342");
$req->setFromDateTime("1564985177000");
$req->setToDateTime("1564985177000");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/schedule/shift/listbydays");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/schedule/shift/listbydays");
OapiAttendanceScheduleShiftListbydaysRequest req = new OapiAttendanceScheduleShiftListbydaysRequest();
req.OpUserId = "dd_dd";
req.Userids = "dd_test,tl2342";
req.FromDateTime = 1564985177000L;
req.ToDateTime = 1564985177000L;
OapiAttendanceScheduleShiftListbydaysResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | TopDayScheduleShiftVo\[] | | The list of returned results. |
| work\_date | Date | 2020-12-14 00:00:00 | The workday. |
| shift\_names | String\[] | \["A"] | The shift names. |
| userid | String | user123 | The user ID of the user. |
| shift\_versions | Number\[] | \[9527] | The shift version IDs. |
| shift\_ids | Number\[] | \[9087] | The shift IDs. |
| group\_id | Number | 7786 | The attendance group ID. |
| corp\_id | String | dinge8xxx | The organization ID. |
| success | Boolean | true | Indicates whether the call succeeded.   - **true**: Success - **false**: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| request\_id | String | 5fyefrdh2mf4 | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "errmsg":"ok",
  "result": [
    {
      "corp_id": "dinge8xxx",
      "group_id": 685935028,
      "shift_ids": [
        677995086
      ],
      "shift_names": [
        "A"
      ],
      "shift_versions": [
        603766106
      ],
      "userid": "user456",
      "work_date": "2020-12-14 00:00:00"
    }
  ],
  "success": true,
  "request_id": "5fyefrdh2mf4"
}
```

### Error Codes

If a call to 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.