Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/group/query |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-qyapi_attendance_group_read-Attendance group query 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 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 | user123 | The userId of the operator. |
| group_id | Number | Yes | 685935028 | The attendance group ID. Call the Batch Get Attendance Group Details API to obtain the group_id value. Note If you have a legacy attendance group identifier (group_key), call the Convert groupKey to groupId API to convert the group_key to a group_id. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/query" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=65671xxxx92ddf0' \
-d 'group_id=23456' \
-d 'op_user_id=dd_dd'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/query");
OapiAttendanceGroupQueryRequest req = new OapiAttendanceGroupQueryRequest();
req.setOpUserId("dd_dd");
req.setGroupId(23456L);
OapiAttendanceGroupQueryResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceGroupQueryRequest("https://api.dingtalk.io/topapi/attendance/group/query")
req.op_user_id="dd_dd"
req.group_id=23456
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 OapiAttendanceGroupQueryRequest;
$req->setOpUserId("dd_dd");
$req->setGroupId("23456");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/query");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/query");
OapiAttendanceGroupQueryRequest req = new OapiAttendanceGroupQueryRequest();
req.OpUserId = "dd_dd";
req.GroupId = 23456L;
OapiAttendanceGroupQueryResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | TopSimpleGroupVO | The returned result. | |
| name | String | Attendance | The attendance group name. |
| shift_ids | Number[] | [677995086] | The shift IDs. |
| id | Number | 685935028 | The attendance group ID. |
| wifis | String[] | [“test-inc”] | The Wi-Fi names. |
| address_list | String[] | [“Xixi Wetland”] | The attendance addresses. |
| work_day_list | Number[] | [0,1,2,3] | The workdays. |
| member_count | Number | 39 | The number of users. |
| type | String | TURN | The attendance group type. - FIXED: A fixed shift attendance group - TURN: A shift-based attendance group - NONE: A flexible working hours attendance group |
| url | String | https://attend.dingtalk.io/xxxx | The redirect link. |
| manager_list | String | user456 | The attendance group Admins. |
| owner_user_id | String | user01 | The userId of the primary owner of the attendance group. |
| success | Boolean | true | Indicates whether the request succeeded. - true: Success - false: Failed |
| errcode | Number | 0 | The return code. |
| request_id | String | 72hycvnsyykp | The request ID. |
Response Body Example
{
"errcode": 0,
"result": {
"address_list": [
"Xixi Wetland"
],
"id": 685935028,
"manager_list": "[user456]",
"member_count": 1,
"name": "Attendance",
"owner_user_id": "user01",
"shift_ids": [
677995086
],
"type": "TURN",
"url": "https://attend.dingtalk.io/xxxx",
"wifis": [
"test-inc"
],
"work_day_list": [
0,
677995086,
677995086,
677995086,
677995086,
678215070,
0
]
},
"success": true,
"request_id": "lps4czm0g3qu"
}