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

# ユーザーのシフト設定サマリーの一括照会

> 複数ユーザーのシフト設定サマリーを最大7日間の期間指定で一括照会する API です。シフト名、シフトバージョン ID、勤怠グループ ID を取得します。

この API を呼び出すと、指定期間内のユーザーのシフト設定サマリーを照会できます。サマリーには、シフト名、シフトバージョン ID、勤怠グループ ID が含まれます。

## リクエスト

| **基本情報** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/schedule/shift/listbydays](https://api.dingtalk.io/topapi/attendance/schedule/shift/listbydays) |
| HTTP メソッド | POST |
| 対応アプリタイプ | appType-社内アプリ |
| 必要な権限 | permission-qyapi\_attendance\_group\_manage-勤怠グループ管理権限 |

### クエリパラメータ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| access\_token | String | はい | 57cf92xxx | この API の呼び出しに使用するアプリ認証情報です。[社内アプリの access\_token の取得](https://help.dingtalk.io/ja/open/development/obtain-orgapp-token) API を呼び出して取得します。 |

### リクエストボディ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| op\_user\_id | String | はい | manager123 | 操作者のユーザー ID です。 |
| userids | String | はい | user123,user456 | 照会するユーザー ID のリストです。複数のユーザー ID はカンマで区切ります。1回の照会で指定できるユーザー ID は最大20件です。 |
| from\_date\_time | Number | はい | 1564985177000 | 開始日の Unix タイムスタンプ（ミリ秒単位）です。  **注意**  期間は7日間を超えることはできません。 |
| to\_date\_time | Number | はい | 1564985177000 | 終了日の Unix タイムスタンプ（ミリ秒単位）です。  **注意**  期間は7日間を超えることはできません。 |

### リクエスト例

```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);
```

## レスポンス

### レスポンスボディ

| 名前 | タイプ | 例 | 説明 |
| - | - | - | - |
| result | TopDayScheduleShiftVo\[] | | 返された結果のリストです。 |
| work\_date | Date | 2020-12-14 00:00:00 | 勤務日です。 |
| shift\_names | String\[] | \["A"] | シフト名です。 |
| userid | String | user123 | ユーザーのユーザー ID です。 |
| shift\_versions | Number\[] | \[9527] | シフトバージョン ID です。 |
| shift\_ids | Number\[] | \[9087] | シフト ID です。 |
| group\_id | Number | 7786 | 勤怠グループ ID です。 |
| corp\_id | String | dinge8xxx | 組織 ID です。 |
| success | Boolean | true | 呼び出しに成功したかどうかを示します。   - **true**：成功 - **false**：失敗 |
| errcode | Number | 0 | リターンコードです。 |
| errmsg | String | ok | リターンコードの説明です。 |
| request\_id | String | 5fyefrdh2mf4 | リクエスト ID です。 |

### レスポンスボディの例

```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"
}
```

### エラーコード

この API の呼び出しでエラーが返された場合は、エラーメッセージをもとに [グローバルエラーコード](https://help.dingtalk.io/ja/open/development/server-api-error-codes-1.md) ドキュメントで解決方法を検索してください。


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