Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/shift/search |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | qyapi_attendance_group_read (attendance group read permission) |
Query Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 6d1bxxxx | The app credential used to call this API. - Internal app: Call the Get the access_token of an internal app API to obtain it. - Third-party enterprise app: Call the Get the access_token of a third-party enterprise API to obtain it. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| op_user_id | String | Yes | manager4220 | The userId of the operator. |
| shift_name | String | Yes | A | The shift name. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/shift/search" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=ab85bxxxx739d5' \
-d 'op_user_id=dd_dd' \
-d 'shift_name=Regular%20Day%20Shift'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/search");
OapiAttendanceShiftSearchRequest req = new OapiAttendanceShiftSearchRequest();
req.setOpUserId("dd_dd");
req.setShiftName("Regular Day Shift");
OapiAttendanceShiftSearchResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceShiftSearchRequest("https://api.dingtalk.io/topapi/attendance/shift/search")
req.op_user_id="dd_dd"
req.shift_name="Regular Day Shift"
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 OapiAttendanceShiftSearchRequest;
$req->setOpUserId("dd_dd");
$req->setShiftName("Regular Day Shift");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/shift/search");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/search");
OapiAttendanceShiftSearchRequest req = new OapiAttendanceShiftSearchRequest();
req.OpUserId = "dd_dd";
req.ShiftName = "Regular Day Shift";
OapiAttendanceShiftSearchResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | TopMinimalismShiftVO[] | The query results. | |
| name | String | Regular Day Shift | The shift name. |
| id | Number | 677995086 | The shift ID. |
| success | Boolean | true | Indicates whether the call succeeded. - true: Success - false: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The return code message. |
| request_id | String | 4wsw01tcq1h4 | The request ID. |
Response Body Example
{
"errcode": 0,
"errmsg":"ok",
"result": [
{
"id": 677995086,
"name": "Regular Day Shift"
}
],
"success": true,
"request_id": "4wsw01tcq1h4"
}