Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/group/users/add |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Permissions | permission-qyapi_attendance_group_manage-Attendance group management permission |
Query Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 4c9ebd2b1534xxxx | 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_userid | String | No | user01 | The user ID of the operator. |
| group_key | String | Yes | CEDDxxxx | The attendance group ID. Note If your attendance group identifier is group_id, call the Convert groupId to groupKey API to convert group_id to group_key. |
| user_id_list | String[] | Yes | user02,user03 | The list of user IDs. Maximum: 100. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/users/add" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=e0f3d9xxxxa9b71' \
-d 'group_key=0151E0xxxx917E876' \
-d 'op_userid=123456' \
-d 'user_id_list=123456%2C123457'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/users/add");
OapiAttendanceGroupUsersAddRequest req = new OapiAttendanceGroupUsersAddRequest();
req.setOpUserid("user01");
req.setGroupKey("CEDDxxxx");
req.setUserIdList("user02,user03");
OapiAttendanceGroupUsersAddResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceGroupUsersAddRequest("https://api.dingtalk.io/topapi/attendance/group/users/add")
req.op_userid="123456"
req.group_key="0151E02xxxx7E876"
req.user_id_list="123456,123457"
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 OapiAttendanceGroupUsersAddRequest;
$req->setOpUserid("123456");
$req->setGroupKey("0151E0xxxx7E876");
$req->setUserIdList("123456,123457");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/users/add");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/users/add");
OapiAttendanceGroupUsersAddRequest req = new OapiAttendanceGroupUsersAddRequest();
req.OpUserid = "123456";
req.GroupKey = "0151E02xxxx917E876";
req.UserIdList = "123456,123457";
OapiAttendanceGroupUsersAddResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | Result | The returned result. | |
| error_info_list | ErrorInfo[] | The list of errors. | |
| failure_list | String[] | The list of failed entries. | |
| msg | String | business fault | The error message. |
| code | String | 1000 | The error code. |
| success_list | String[] | The list of successful entries. | |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| success | Boolean | true | Whether the request succeeded. - true: Success - false: Failed |
| request_id | String | w8iju9gfb236 | The request ID. |
Response Body Example
{
"errcode": 0,
"result": {
"success_list": [
"user456",
"manager4220"
]
},
"success": true,
"request_id": "w8iju9gfb236"
}