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 |
| 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. - 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 -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'
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());
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)
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");
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
{
"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"
}