Request
| Basic Information | |
|---|---|
| HTTP URL | 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. - 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 -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'
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());
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)
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");
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. |
| 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
{
"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"
}