Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/getupdatedata |
| HTTP Method | POST |
| Supported app types | appType-Internal app |
| Permissions | permission-qyapi_get_attendance_data-Attendance data read permission |
Query Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 6d1bxxxx | The app credential used to call this API. Get it by calling the Get the access_token of an Internal App API. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| userid | String | Yes | user01 | The user ID. |
| work_date | Date | Yes | 2021-01-14 | The query date. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/getupdatedata" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=e67ccxxxx2144c' \
-d 'userid=userId123456' \
-d 'work_date=2018-05-02+00%3A00%3A00'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getupdatedata");
OapiAttendanceGetupdatedataRequest req = new OapiAttendanceGetupdatedataRequest();
req.setUserid("user01");
req.setWorkDate(StringUtils.parseDateTime("2021-01-14"));
OapiAttendanceGetupdatedataResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceGetupdatedataRequest("https://api.dingtalk.io/topapi/attendance/getupdatedata")
req.userid="userId123456"
req.work_date="2018-05-02 00:00:00"
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 OapiAttendanceGetupdatedataRequest;
$req->setUserid("userId123456");
$req->setWorkDate("2018-05-02 00:00:00");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/getupdatedata");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getupdatedata");
OapiAttendanceGetupdatedataRequest req = new OapiAttendanceGetupdatedataRequest();
req.Userid = "userId123456";
req.WorkDate = DateTime.Parse("2018-05-02 00:00:00");
OapiAttendanceGetupdatedataResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| errmsg | String | ok | The description of the return code. |
| result | AtCheckInfoForOpenVo | The call result. | |
| work_date | Date | 2021-01-14 00:00:00 | The query date. |
| attendance_result_list | AtAttendanceResultForOpenVo[] | The clock-in results. | |
| record_id | Number | 53429818546 | The clock-in record ID. |
| source_type | String | USER | The clock-in source. - USER: Clock-in by the user - BOSS: Corrected by the manager - APPROVE: Approval system - SYSTEM: Attendance system - AUTO_CHECK: Automatic clock-in |
| plan_check_time | Date | 2021-01-14 09:00:00 | The standard clock-in time. |
| class_id | Number | 709595172 | The shift ID. |
| location_method | String | MAP | The location method. |
| location_result | String | Normal | The location result. - Normal: Within range - Outside: Out of range - NotSigned: Not clocked in |
| outside_remark | String | Field work | The field work note. |
| plan_id | Number | 176929277767 | The scheduling ID. |
| user_address | String | Greentown Future Park | The address where the user clocked in. |
| group_id | Number | 710705191 | The attendance group ID. |
| user_check_time | Date | 2021-01-14 11:21:59 | The time when the user clocked in. |
| procInst_id | String | PRO-xxx | The approval form ID. |
| check_type | String | OnDuty | The clock-in type. - OnDuty: Clock in - OffDuty: Clock out |
| time_result | String | Late | The time result of the clock-in. - Normal: Normal - Early: Early leave - Late: Late arrival - SeriousLate: Serious late arrival - Absenteeism: Absenteeism due to late arrival - NotSigned: Not clocked in |
| userid | String | user01 | The user ID. |
| approve_list | AtApproveForOpenVo[] | The list of approval forms. | |
| duration_unit | String | day | The unit of the approval form. |
| duration | String | 2.0 | The duration. |
| sub_type | String | Annual leave | The subtype name. |
| tag_name | String | 请假 (Leave request) | The approval form type name. Supported types: - 请假 (Leave request) - 出差 (Business trip) - 外出 (Going out) - 加班 (Overtime) |
| procInst_id | String | 1234abcd | The approval form ID. |
| begin_time | Date | 2019-08-15 | The start time of the approval form. |
| biz_type | Number | 3 | The approval form type: - 1: Overtime - 2: Business trip/Going out - 3: Leave request |
| end_time | Date | 2019-08-17 | The end time of the approval form. |
| gmt_finished | Date | 2019-08-15 | The time when the approval form was approved. |
| check_record_list | AtAttendanceRecordForOpenVo[] | The clock-in details. | |
| record_id | Number | 52710882700 | The clock-in record ID. |
| source_type | String | The clock-in source. - USER: Clock-in by the user - BOSS: Corrected by the manager - APPROVE: Approval system - SYSTEM: Attendance system - AUTO_CHECK: Automatic clock-in | |
| user_accuracy | String | 15.0 | The user’s location accuracy. |
| valid_matched | Boolean | false | Indicates whether the record matches the clock-in result. - true: Matched - false: Not matched |
| user_check_time | Date | 2021-01-14 11:19:04 | The time when the user clocked in. |
| user_longitude | String | 120.017267 | The clock-in longitude. |
| user_ssid | String | office-wifi-1 | The Wi-Fi name. |
| base_accuracy | String | 0.0 | The basic location accuracy. |
| user_mac_addr | String | 11:11:11:11:11:11 | The MAC address. |
| user_latitude | String | 30.285938 | The clock-in latitude. |
| base_address | String | Test | The basic clock-in address. |
| invalid_record_msg | String | Secondary confirmation required | The reason why the clock-in is invalid. |
| invalid_record_type | String | Other | The type of invalid clock-in. |
| corpId | String | dinge8xxxx | The organization ID (corpId). |
| class_setting_info | AtClassSettingInfoForOpenVo | The break periods for the current schedule. | |
| rest_time_vo_list | AtRestTimeVo[] | The break information within the shift. | |
| rest_end_time | Number | 0 | The break end time. |
| rest_begin_time | Number | 0 | The break start time. |
| errcode | Number | 0 | The return code. |
| success | Boolean | true | Indicates whether the call succeeded. - true: Success - false: Failed |
| request_id | String | f1zwcp4fr28h | The request ID. |
Response Body Example
{
"errcode": 0,
"result": {
"approve_list": [],
"attendance_result_list": [
{
"location_method": "MAP",
"record_id": 53429818546,
"group_id": 710705191,
"location_result": "Normal",
"class_id": 709595172,
"time_result": "Late",
"user_address": "Greentown Future Park",
"user_check_time": "2021-01-14 11:21:59",
"plan_check_time": "2021-01-14 09:00:00",
"check_type": "OnDuty",
"source_type": "USER",
"plan_id": 176929277767
}
],
"corpId": "dinge8xxxx",
"work_date": "2021-01-14 09:00:00",
"userid": "user01",
"check_record_list": [
{
"record_id": 52710882700,
"user_check_time": "2021-01-14 11:19:04",
"valid_matched": false,
"user_accuracy": "15.0",
"source_type": "USER",
"invalid_record_msg": "Field clock-in requires approval",
"invalid_record_type": "Other",
"user_longitude": "120.017267",
"user_latitude": "30.286036"
},
{
"record_id": 53019968340,
"user_check_time": "2021-01-14 17:00:45",
"valid_matched": false,
"source_type": "USER",
"invalid_record_msg": "Clock-in is not available at this time. Contact your admin.",
"invalid_record_type": "Other"
}
]
},
"success": true,
"request_id": "f1zwcp4fr28h"
}