> ## 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 the Scheduling Information of a User

> Call this API to query a user's scheduling for a specific day using the operator userId, target userId, and a millisecond timestamp.

Call this API to query the scheduling information of a user on a specific day.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/schedule/listbyday](https://api.dingtalk.io/topapi/attendance/schedule/listbyday) |
| HTTP Method | POST |
| Supported app types | appType-Internal app　appType-Third-party enterprise app |
| Permissions | qyapi\_attendance\_group\_read (attendance group read permission) |

### Query Parameters

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

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| op\_user\_id | String | Yes | manager123 | The userId of the operator. |
| user\_id | String | Yes | dd\_dd | The userId of the user to query. |
| date\_time | Number | Yes | 1564145519000 | The date to query, as a Unix timestamp in milliseconds. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/schedule/listbyday" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=5d7f91f3-e22c-41ca-aee3-aa008603e00b' \
-d 'date_time=1564145519000' \
-d 'op_user_id=dd_dd' \
-d 'user_id=dd_dd'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/schedule/listbyday");
OapiAttendanceScheduleListbydayRequest req = new OapiAttendanceScheduleListbydayRequest();
req.setOpUserId("user123");
req.setUserId("user456");
req.setDateTime(1564145519000L);
OapiAttendanceScheduleListbydayResponse 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.OapiAttendanceScheduleListbydayRequest("https://api.dingtalk.io/topapi/attendance/schedule/listbyday")

req.op_user_id="dd_dd"
req.user_id="dd_dd"
req.date_time=1564145519000
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 OapiAttendanceScheduleListbydayRequest;
$req->setOpUserId("dd_dd");
$req->setUserId("dd_dd");
$req->setDateTime("1564145519000");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/schedule/listbyday");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/schedule/listbyday");
OapiAttendanceScheduleListbydayRequest req = new OapiAttendanceScheduleListbydayRequest();
req.OpUserId = "dd_dd";
req.UserId = "dd_dd";
req.DateTime = 1564145519000L;
OapiAttendanceScheduleListbydayResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | TopScheduleVo\[] | | The query result. |
| check\_type | String | OnDuty | The attendance type:   - **Onduty**: Clock-in for work start - **OffDuty**: Clock-in for work end |
| approve\_type | String | demo | The Approval type.  **Note**  This Field is not returned if there is no Approval form for the day. |
| gmt\_modified | Date | 2020-11-10 14:33:13 | Last modified time. |
| gmt\_create | Date | 2020-10-26 03:26:59 | Created time. |
| corp\_id | String | dinge8xxxx | The organization ID (corpId). View it on the Home page of the [Developer Console](https://open-dev.dingtalk.io/). |
| check\_date\_time | Date | 2020-11-10 14:33:13 | The clock-in time of the Employee. |
| group\_id | Number | 394775001 | The attendance group ID. |
| class\_name | String | dsdsd | The shift name. |
| user\_id | String | dd\_test | The userId of the User. |
| approve\_biz\_type | Number | demo | The leave and attendance approval type bound to the scheduling:   - **1**: Overtime - **2**: Business trip - **3**: Leave   **Note**  This Field is not returned if there is no Approval form for the day. |
| approve\_id | Number | 123 | The ID of the Approval form bound to the scheduling.  **Note**  This Field is not returned if there is no Approval form for the day. |
| class\_setting\_id | Number | 297490031 | The ID of the shift settings associated with the scheduling.  **Note**  This Field is not returned if global settings are used. |
| approve\_tag\_name | String | Leave | The name of the leave and attendance approval form bound to the scheduling.  **Note**  This Field is not returned if there is no Approval form for the day. |
| features | String | `{\"dataSource\":\"adminSetting\",\"flexMinutes\":[60,60],\"overtimeSettingId\":221375127,\"punchId\":524588947}` | Extended fields.   - **dataSource**: This Field currently has no practical meaning. - **flexMinutes**: The flexible time allowed by the shift settings for arriving late and leaving late, or arriving early and leaving early, in minutes. - **punchId**: The ID of the corresponding clock-in point. - **overtimeSettingId**: The overtime rules ID. |
| class\_id | Number | 370370019 | The shift ID. |
| check\_status | String | Timeout | The clock-in status:   - **Init**: Not clocked in - **Checked**: Clocked in - **Timeout**: Missed clock-in |
| work\_date | Date | 2020-11-10 00:00:00 | The workday, indicating the specific day of the scheduling. |
| check\_end\_time | Date | 2020-09-08 09:30:00 | The end time of the clock-in window. |
| is\_rest | String | N | Whether the day is a rest day:   - **Y**: Scheduled as a rest day - **N**: Not a rest day |
| check\_begin\_time | Date | 2020-09-08 09:00:00 | The start time of the clock-in window. |
| real\_plan\_time | Date | 2020-09-08 10:00:00 | The time at which the User should clock in after flexible working hours adjustment is turned on for the clock-in point. |
| id | Number | 56676915454 | The scheduling ID. |
| success | Boolean | true | Indicates whether the request succeeded.   - **true**: Success - **false**: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | demo | The description of the return code. |
| request\_id | String | 6bzhf2vn89pv | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "result": [
    {
      "check_date_time": "2020-11-10 09:30:00",
      "check_status": "Timeout",
      "check_type": "OnDuty",
      "class_id": 677995086,
      "class_name": "A",
      "class_setting_id": 599315627,
      "corp_id": "dinge8xxxx",
      "features": "{\"flexMinutes\":[30,30],\"overtimeSettingId\":581490201,\"punchId\":346266563}",
      "gmt_create": "2020-10-26 03:26:59",
      "gmt_modified": "2020-11-10 14:33:13",
      "group_id": 685935028,
      "id": 156270023005,
      "is_rest": "N",
      "real_plan_time": "2020-11-10 09:30:00",
      "user_id": "user123",
      "work_date": "2020-11-10 00:00:00"
    },
    {
      "check_date_time": "2020-11-10 18:30:00",
      "check_status": "Timeout",
      "check_type": "OffDuty",
      "class_id": 677995086,
      "class_name": "A",
      "class_setting_id": 599315627,
      "corp_id": "dinge8xxxx",
      "features": "{\"flexMinutes\":[30,30],\"overtimeSettingId\":581490201,\"punchId\":346266564}",
      "gmt_create": "2020-10-26 03:26:59",
      "gmt_modified": "2020-11-11 02:30:45",
      "group_id": 685935028,
      "id": 156270023006,
      "is_rest": "N",
      "real_plan_time": "2020-11-10 18:30:00",
      "user_id": "user123",
      "work_date": "2020-11-10 00:00:00"
    }
  ],
  "success": true,
  "request_id": "6bzhf2vn89pv"
}
```

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