Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/shift/list |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permissions | permission-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. - 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 the API for getting the access_token of a third-party organization. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| op_user_id | String | Yes | manager4220 | The userId of the operator. |
| cursor | Number | No | 0 | The cursor ID. The initial value is 0. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/shift/list" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=e47ef3ff-ff01-4da7-8aa8-53bc0ad47be3' \
-d 'cursor=1234' \
-d 'op_user_id=dd_test'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/list");
OapiAttendanceShiftListRequest req = new OapiAttendanceShiftListRequest();
req.setOpUserId("dd_test");
req.setCursor(0L);
OapiAttendanceShiftListResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceShiftListRequest("https://api.dingtalk.io/topapi/attendance/shift/list")
req.op_user_id="dd_test"
req.cursor=1234
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 OapiAttendanceShiftListRequest;
$req->setOpUserId("dd_test");
$req->setCursor("1234");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/shift/list");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/list");
OapiAttendanceShiftListRequest req = new OapiAttendanceShiftListRequest();
req.OpUserId = "dd_test";
req.Cursor = 1234L;
OapiAttendanceShiftListResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | PageResult | The query result. | |
| has_more | Boolean | false | Whether more data is available. - true: Yes - false: No |
| cursor | Number | 678215070 | The cursor position of the next page. |
| result | TopMinimalismShiftVo[] | The shift information. Each page returns 200 records. Results with more than 200 records are paginated. | |
| name | String | A | The shift name. |
| id | Number | 677995086 | The shift ID. |
| success | Boolean | true | Whether the request succeeded. - true: Success - false: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| request_id | String | 1079sd06ne6zy | The request ID. |
Response Body Example
{
"errcode": 0,
"errmsg":"ok",
"result": {
"cursor": 678215070,
"has_more": false,
"result": [
{
"id": 677995086,
"name": "A"
},
{
"id": 678215070,
"name": "B"
}
]
},
"success": true,
"request_id": "1079sd06ne6zy"
}