Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/shift/query |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permissions | permission-qyapi_attendance_group_read-Attendance group query permission |
Query Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | bE74xxxx | The App credential used to call this API. - For an Internal app, call the Get the access_token of an Internal App API to obtain it. - For a Third-party enterprise app, call the Get the access_token of a Third-party Enterprise App API to obtain it. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| op_user_id | String | Yes | user123 | The userId of the operator. |
| shift_id | Number | Yes | 678215070 | The shift ID. Call the Get Shift Summaries API to obtain the value of the id parameter. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/shift/query" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=d946568c-08dd-44bf-acd3-cfc07d7829dd' \
-d 'op_user_id=dd_dd' \
-d 'shift_id=2445'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/query");
OapiAttendanceShiftQueryRequest req = new OapiAttendanceShiftQueryRequest();
req.setOpUserId("user123");
req.setShiftId(678215070L);
OapiAttendanceShiftQueryResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceShiftQueryRequest("https://api.dingtalk.io/topapi/attendance/shift/query")
req.op_user_id="dd_dd"
req.shift_id=2445
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 OapiAttendanceShiftQueryRequest;
$req->setOpUserId("dd_dd");
$req->setShiftId("2445");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/shift/query");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/query");
OapiAttendanceShiftQueryRequest req = new OapiAttendanceShiftQueryRequest();
req.OpUserId = "dd_dd";
req.ShiftId = 2445L;
OapiAttendanceShiftQueryResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | TopShiftVo | The shift details. | |
| shift_group_name | String | Attendance shift | The name of the shift group. |
| corp_id | String | dinge87f1xxxx | The organization ID. |
| shift_setting | TopShiftSettingVo | The shift settings. | |
| shift_id | Number | 678215070 | The shift ID. |
| gmt_modified | Date | 2020-09-06 15:49:27 | The time when the shift was last modified. |
| corp_id | String | dinge87f1xxxx | The organization ID. |
| work_time_minutes | Number | 600 | The working duration, in minutes. A value of -1 indicates that this feature is disabled. |
| id | Number | 233840112 | The shift settings ID. |
| attend_days | String | 12 | The number of attendance days for this shift. |
| gmt_create | Date | 2020-09-06 15:49:27 | The created time. |
| name | String | B | The shift name. |
| id | Number | 678215070 | The shift ID. |
| sections | TopSectionVo[] | The clock-in sections. | |
| punches | TopPunchVo[] | The clock-in points. | |
| check_type | String | OnDuty | The clock-in type: - OnDuty: Clock in - OffDuty: Clock out |
| end_min | Number | -1 | The latest allowed clock-in time. The value is in minutes. Add this value to the clock-in time to calculate the latest clock-in time. |
| across | Number | 0 | Whether the clock-in time falls on the next day: - 0: Same day - 1: Next day |
| check_time | Date | 1970-01-01 19:00:00 | The clock-in time, as a Unix timestamp. Only the hour, minute, and second are meaningful. |
| permit_minutes | Number | 0 | The allowed duration of early leave or late arrival, in minutes. |
| free_check | Boolean | false | Whether clock-in is exempted: - true: Clock-in exempted - false: Clock-in required |
| id | Number | 33928201 | The clock-in point ID. |
| begin_min | Number | 20 | The earliest allowed time to clock in in advance, in minutes. |
| absenteeism_late_minutes | String | -1 | The duration of early leave or late arrival that counts as absenteeism, in minutes. |
| serious_late_minutes | String | -1 | The duration of early leave or late arrival that counts as serious, in minutes. |
| rests | TopRestVo[] | The break period information. | |
| check_type | String | OnDuty | The break type: - OnDuty: Break start - OffDuty: Break end |
| across | Number | 1 | Whether the break time falls on the next day: - 0: Same day - 1: Next day |
| check_time | String | 1970-01-01 05:00:00 | The break time. |
| id | Number | 33928203 | The break point ID. |
| id | Number | 22979360 | The clock-in section ID. One clock-in and clock-out pair forms a section. A shift can contain multiple sections. |
| shift_group_id | Number | demo | The shift group ID. |
| owner | String | user123 | The userId of the shift owner. |
| success | Boolean | true | Whether the call succeeded. - true: Success - false: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | demo | The description of the return code. |
Response Body Example
{
"errcode": 0,
"errmsg": "demo",
"result": {
"corp_id": "dinge87f1xxxx",
"id": 678215070,
"name": "B",
"sections": [
{
"id": 316940162,
"punches": [
{
"absenteeism_late_minutes": "-1",
"across": 0,
"check_time": "1970-01-01 19:00:00",
"check_type": "OnDuty",
"free_check": false,
"id": 340055347,
"permit_minutes": 0,
"serious_late_minutes": "-1"
},
{
"across": 1,
"check_time": "1970-01-01 05:00:00",
"check_type": "OffDuty",
"free_check": false,
"id": 340055348
}
],
"rests": []
}
],
"shift_setting": {
"corp_id": "dinge87f1xxxx",
"gmt_create": "2020-09-06 15:49:27",
"gmt_modified": "2020-09-06 15:49:27",
"id": 586985140,
"is_deleted": "N",
"shift_id": 678215070,
"work_time_minutes": 600
}
},
"success": true,
"request_id": "3pph7tq865kz"
}