Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/group/member/update |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | qyapi_attendance_group_manage (Attendance group management 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 API for obtaining the access_token of a third-party organization to obtain it. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| op_user_id | String | Yes | user123 | The userId of the operator. |
| group_id | Number | Yes | 98562 | The attendance group ID. Note If you use the legacy attendance group identifier (group_key), call the Convert groupKey to groupId API to convert group_key to group_id. |
| schedule_flag | Number | Yes | 0 | The day from which scheduling starts. - 0: Start scheduling today - 1: Start scheduling tomorrow |
| update_param | TopGroupMemberUpdateParam | Yes | The attendance group update information. | |
| remove_extra_users | String[] | No | [“user123”,“user456”] | The attendance-exempt members to remove. Leave empty if not applicable. Pass up to 20 userIds per call. |
| remove_depts | String[] | No | [“123”,“456”] | The attendance departments to remove. Leave empty if not applicable. Pass up to 20 department IDs per call. |
| remove_users | String[] | No | [“user123”,“user456”] | The attendance members to remove. Leave empty if not applicable. Pass up to 20 userIds per call. |
| add_depts | String[] | No | [“123”,“456”] | The attendance departments to add. Leave empty if not applicable. Pass up to 20 department IDs per call. |
| add_users | String[] | No | [“user123”,“user456”] | The attendance members to add. Leave empty if not applicable. Pass up to 20 userIds per call. |
| add_extra_users | String[] | No | [“user123”,“user456”] | The attendance-exempt members to add. Leave empty if not applicable. Pass up to 20 userIds per call. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/member/update" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=0142dxxxxa6204' \
-d 'group_id=122' \
-d 'op_user_id=dd_dd' \
-d 'schedule_flag=0' \
-d 'update_param=null'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/member/update");
OapiAttendanceGroupMemberUpdateRequest req = new OapiAttendanceGroupMemberUpdateRequest();
req.setOpUserId("user123");
req.setGroupId(98562L);
req.setScheduleFlag(0L);
TopGroupMemberUpdateParam updateParam = new TopGroupMemberUpdateParam();
updateParam.setAddDepts(Arrays.asList("123"));
updateParam.setRemoveDepts(Arrays.asList("456"));
updateParam.setAddUsers(Arrays.asList("user123"));
updateParam.setAddExtraUsers(Arrays.asList("user456"));
updateParam.setRemoveExtraUsers(Arrays.asList("user789"));
updateParam.setRemoveUsers(Arrays.asList("user121"));
req.setUpdateParam(updateParam);
OapiAttendanceGroupMemberUpdateResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceGroupMemberUpdateRequest("https://api.dingtalk.io/topapi/attendance/group/member/update")
req.op_user_id="dd_dd"
req.group_id=122
req.schedule_flag=0
req.update_param=""
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 OapiAttendanceGroupMemberUpdateRequest;
$req->setOpUserId("dd_dd");
$req->setGroupId("122");
$req->setScheduleFlag("0");
$update_param = new TopGroupMemberUpdateParam;
$update_param->remove_extra_users="dd_test";
$update_param->remove_depts="1234";
$update_param->remove_users="dd_dd";
$update_param->add_depts="123";
$update_param->add_users="dd_mana";
$update_param->add_extra_users="dd_d";
$req->setUpdateParam($update_param);
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/member/update");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/member/update");
OapiAttendanceGroupMemberUpdateRequest req = new OapiAttendanceGroupMemberUpdateRequest();
req.OpUserId = "dd_dd";
req.GroupId = 122L;
req.ScheduleFlag = 0L;
OapiAttendanceGroupMemberUpdateRequest.TopGroupMemberUpdateParamDomain obj1 = new OapiAttendanceGroupMemberUpdateRequest.TopGroupMemberUpdateParamDomain();
obj1.RemoveExtraUsers = "dd_test";
obj1.RemoveDepts = "1234";
obj1.RemoveUsers = "dd_dd";
obj1.AddDepts = "123";
obj1.AddUsers = "dd_mana";
obj1.AddExtraUsers = "dd_d";
req.UpdateParam_ = obj1;
OapiAttendanceGroupMemberUpdateResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| request_id | String | 3pgsafymemlr | The request ID. |
| errcode | Number | 0 | The return code. |
| success | Boolean | true | Indicates whether the call succeeded. - true: Success - false: Failed |
Response Body Example
{
"errcode": 0,
"success": true,
"request_id": "5sj3lgigiqm9"
}