请求
| 基本信息 | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/schedule/result/listbyids |
| HTTP Method | POST |
| 支持的应用类型 | appType-企业内部应用 appType-第三方企业应用 |
| 权限要求 | permission-qyapi_attendance_group_read-考勤组查询权限 |
查询参数
| 名称 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
| access_token | String | 是 | bE74xxxx | 调用该API的应用凭证。 - 企业内部应用,通过获取企业内部应用的access_token接口获取。 - 第三方企业应用,通过获取第三方企业的access_token接口获取。 |
请求体
| 名称 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
| op_user_id | String | 是 | manager123 | 操作人userId。 |
| schedule_ids | String | 是 | 144872188723,144872188722 | 排班ID,通过查询企业考勤排班详情接口获取plan_id参数值。多个排班ID之间用逗号分割,每次调用最多支持100个排班ID, |
请求示例
curl -X POST "https://api.dingtalk.io/topapi/attendance/schedule/result/listbyids" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=711cexxxx8ce772' \
-d 'op_user_id=dd_dd' \
-d 'schedule_ids=1234%2C3214'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/schedule/result/listbyids");
OapiAttendanceScheduleResultListbyidsRequest req = new OapiAttendanceScheduleResultListbyidsRequest();
req.setOpUserId("user456");
req.setScheduleIds("16xxxx530,160xxxx12");
OapiAttendanceScheduleResultListbyidsResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceScheduleResultListbyidsRequest("https://api.dingtalk.io/topapi/attendance/schedule/result/listbyids")
req.op_user_id="dd_dd"
req.schedule_ids="[1234,3214]"
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 OapiAttendanceScheduleResultListbyidsRequest;
$req->setOpUserId("dd_dd");
$req->setScheduleIds("[1234,3214]");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/schedule/result/listbyids");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/schedule/result/listbyids");
OapiAttendanceScheduleResultListbyidsRequest req = new OapiAttendanceScheduleResultListbyidsRequest();
req.OpUserId = "dd_dd";
req.ScheduleIds = "1234,3214";
OapiAttendanceScheduleResultListbyidsResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
响应
响应体
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| result | TopScheduleResultVo[] | demo | 查询结果。 |
| check_type | String | OnDuty | 考勤类型: - Onduty:上班打卡 - OffDuty:下班打卡 |
| gmt_modified | Date | 2020-11-11 19:03:21 | 最后更新时间。 |
| plan_check_time | Date | 2020-11-11 19:03:20 | 计划打卡时间。 |
| corp_id | String | dingxxxxx1c1 | 企业的corpId。 |
| base_check_time | Date | 2020-11-11 19:03:00 | 允许迟到早退等规则调整后的计划打卡时间。 |
| group_id | Number | 67xxxx4 | 考勤组ID。 |
| gmt_create | Date | 2020-11-11 19:03:21 | 创建时间。 |
| user_id | String | user123 | 用户的userId。 |
| work_date | Date | 2020-11-11 00:00:00 | 工作日,代表具体哪一天的排班。 |
| id | Number | 11xxxx19 | 打卡结果ID。 |
| location_result | String | Normal | 打卡位置结果: - Normal:正常打卡 - NotSigned:未打卡 - Outside:外勤 |
| is_legal | String | Y | 打卡是否有异常: - N:没有 - Y:有 |
| time_result | String | Normal | 打卡时间结果: - Normal:正常打卡 - NotSigned:未打卡 - Late:迟到 - SeriousLate:严重迟到 - Absenteeism:旷工迟到 - Early:早退 |
| record_id | Number | 48xxxx644 | 打卡记录。 |
| user_check_time | Date | 2020-11-11 19:03:20 | 打卡时间。 |
| schedule_id | Number | 5672xxxx63 | 排班ID。 |
| success | Boolean | true | 是否成功标记。 - true:成功 - false:失败 |
| errcode | Number | 0 | 返回码。 |
| errmsg | String | ok | 返回码描述。 |
| request_id | String | 6k9c3cvix353 | 请求ID。 |
响应体示例
{
"errcode": 0,
"errmsg":"ok",
"result": [
{
"base_check_time": "2020-11-11 19:03:00",
"check_type": "OnDuty",
"corp_id": "dingxxxxx1c1",
"gmt_create": "2020-11-11 19:03:21",
"gmt_modified": "2020-11-11 19:03:21",
"group_id": 67xxxx4,
"id": 11xxxx19,
"is_legal": "Y",
"location_result": "Normal",
"plan_check_time": "2020-11-11 19:03:20",
"record_id": 48xxxx644,
"schedule_id": 16xxxx812,
"time_result": "Normal",
"user_check_time": "2020-11-11 19:03:20",
"user_id": "user456",
"work_date": "2020-11-11 00:00:00"
}
],
"success": true,
"request_id": "6k9c3cvix353"
}