> ## 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 Scheduling Details of an Organization

> Call this API to query the attendance shifts and scheduling information of all employees in your organization on a specified date, with pagination support.

Call this API to query the attendance shift and scheduling information of all employees in your organization on a specific day.

## API Call Description

* For fixed shift attendance, only scheduling information for the next 15 days is available.
* This API is available only to organizations with fewer than 10,000 members.

## Request

| **Basic information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/listschedule](https://api.dingtalk.io/topapi/attendance/listschedule) |
| HTTP Method | POST |
| Supported app types | appType-Internal app　appType-Third-party enterprise app |
| Required permissions | permission-qyapi\_base-Basic permissions required to call organization APIs |

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | bE74xxxx | The app credential used to call this API.   - For an Internal app, obtain it by calling [Get the access\_token of an internal app](https://help.dingtalk.io/open/development/obtain-orgapp-token). - For a Third-party enterprise app, obtain it by calling Get the access\_token of a third-party organization. |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| workDate | Date | Yes | 2020-09-06 | The scheduling date. Only the year, month, and day are used. |
| offset | Number | No | 0 | The pagination offset, starting from 0. Takes effect only when set together with the size parameter. |
| size | Number | No | 200 | The page size. Maximum value: 200. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/listschedule" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=b9305xxxxea83' \
-d 'offset=0' \
-d 'size=200' \
-d 'workDate=2016-03-09+11%3A11%3A11'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/listschedule");
OapiAttendanceListscheduleRequest req = new OapiAttendanceListscheduleRequest();
req.setWorkDate(StringUtils.parseDateTime("2016-03-09 11:11:11"));
req.setOffset(0L);
req.setSize(200L);
OapiAttendanceListscheduleResponse 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.OapiAttendanceListscheduleRequest("https://api.dingtalk.io/topapi/attendance/listschedule")

req.workDate="2016-03-09 11:11:11"
req.offset=0
req.size=200
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 OapiAttendanceListscheduleRequest;
$req->setWorkDate("2016-03-09 11:11:11");
$req->setOffset("0");
$req->setSize("200");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/listschedule");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/listschedule");
OapiAttendanceListscheduleRequest req = new OapiAttendanceListscheduleRequest();
req.WorkDate = DateTime.Parse("2016-03-09 11:11:11");
req.Offset = 0L;
req.Size = 200L;
OapiAttendanceListscheduleResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | AtScheduleListForTopVo | | The query result. |
| schedules | AtScheduleForTopVo\[] | | The schedule list. |
| plan\_id | Number | 157062792171 | The scheduling ID. |
| check\_type | String | OnDuty | The clock-in type:   - **Onduty**: Clock in - **OffDuty**: Clock out |
| approve\_id | Number | 1 | The approval ID.  **Note**  This parameter is not returned if there is no approval form. |
| userid | String | user01 | The user ID of the attendance user. |
| class\_id | Number | 677995086 | The attendance shift ID. |
| class\_setting\_id | Number | 599315627 | The shift configuration ID.  **Note**  This parameter is not returned if the global configuration is used. |
| plan\_check\_time | Date | 2020-11-11 09:30:00 | The clock-in time. |
| group\_id | Number | 685935028 | The attendance group ID. |
| changed\_check\_time | Date | 2020-09-06 15:36:04 | The adjusted clock-in time. |
| has\_more | Boolean | false | Indicates whether there is a next page.   - **true**: Yes - **false**: No |
| errmsg | String | ok | The return code description. |
| errcode | Number | 0 | The return code. |
| request\_id | String | 6ha75i2o99fj | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "errmsg":"ok",
  "result": {
    "has_more": false,
    "schedules": [
      {
        "check_type": "OnDuty",
        "class_id": 677995086,
        "class_setting_id": 599315627,
        "group_id": 685935028,
        "plan_check_time": "2020-11-11 09:30:00",
        "plan_id": 157062792171,
        "userid": "user01"
      },
      {
        "check_type": "OffDuty",
        "class_id": 677995086,
        "class_setting_id": 599315627,
        "group_id": 685935028,
        "plan_check_time": "2020-11-11 18:30:00",
        "plan_id": 157062792172,
        "userid": "user01"
      }
    ]
  },
  "request_id": "6ha75i2o99fj"
}
```

### Error Codes

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


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