Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/shift/updatepunches |
| HTTP Method | POST |
| Supported App Type | appType-Internal app |
| Required Permissions | permission-qyapi_attendance_group_manage-Attendance group management permission |
Query Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | af21axxx | The App credential used to call this API. Obtain it by calling the Get the access_token of an Internal App API. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| op_user_id | String | Yes | user456 | The userId of the operator. |
| punches | TopPunchVO[] | No | The check point information. | |
| id | Number | Yes | 123 | The check point ID. Obtain the id value by calling the Get Shift Details API. |
| free_check | Boolean | Yes | true | Specifies whether clock-in is not required. - true: Clock-in exemption is on. - false: Clock-in exemption is off. |
| shift_id | Number | Yes | 456 | The shift ID. Obtain the id value by calling the Get Shift Summaries API. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/shift/updatepunches" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=16869xxx0e890' \
-d 'op_user_id=dd' \
-d 'punches=null' \
-d 'shift_id=456'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/updatepunches");
OapiAttendanceShiftUpdatepunchesRequest req = new OapiAttendanceShiftUpdatepunchesRequest();
List<TopPunchVO> punchVOS = new ArrayList<>();
TopPunchVO punchVO = new TopPunchVO();
punchVO.setFreeCheck(true);
punchVO.setId(373271823L);
req.setPunches(punchVOS);
req.setOpUserId("user456");
req.setShiftId(712550377L);
OapiAttendanceShiftUpdatepunchesResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceShiftUpdatepunchesRequest("https://api.dingtalk.io/topapi/attendance/shift/updatepunches")
req.op_user_id="dd"
req.punches=""
req.shift_id=456
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 OapiAttendanceShiftUpdatepunchesRequest;
$req->setOpUserId("dd");
$punches = new TopPunchVO;
$punches->id="123";
$punches->free_check="true";
$req->setPunches(array($punches));
$req->setShiftId("456");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/shift/updatepunches");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/shift/updatepunches");
OapiAttendanceShiftUpdatepunchesRequest req = new OapiAttendanceShiftUpdatepunchesRequest();
req.OpUserId = "dd";
List<OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain> list2 = new List<OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain>();
OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain obj3 = new OapiAttendanceShiftUpdatepunchesRequest.TopPunchVODomain();
list2.Add(obj3);
obj3.Id = 123L;
obj3.FreeCheck = true;
req.Punches_ = list2;
req.ShiftId = 456L;
OapiAttendanceShiftUpdatepunchesResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| success | Boolean | true | Indicates whether the call succeeded. - true: Success - false: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | System error | The error message returned when the call fails. |
| request_id | String | 5moh5icna65x | The request ID. |
Response Body Example
{
"errcode": 0,
"success": true,
"request_id": "ed67bcymo0bw"
}