API Call Description
In the DingTalk Attendance app, an attendance group is a set of users or departments that share the same attendance rules, such as shifts and attendance locations. Organizations can create multiple attendance groups based on business needs.Unlike the Get Attendance Group Details API, this API returns attendance group information that includes shift settings.
Request
| Basic information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/getsimplegroups |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permissions | permission-qyapi_base-Basic permission required to call organization APIs |
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. - For a Third-party enterprise app, call the API for getting the access_token of a third-party organization. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| offset | Number | No | 0 | The pagination offset. Takes effect only when set together with the size parameter. The offset starts from 0. In the next call, pass the sum of size and offset from the previous call. |
| size | Number | No | 10 | The page size. Maximum value: 10. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/getsimplegroups" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=c4a715xxxx0a0da2' \
-d 'offset=0' \
-d 'size=10'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getsimplegroups");
OapiAttendanceGetsimplegroupsRequest req = new OapiAttendanceGetsimplegroupsRequest();
req.setOffset(0L);
req.setSize(10L);
OapiAttendanceGetsimplegroupsResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceGetsimplegroupsRequest("https://api.dingtalk.io/topapi/attendance/getsimplegroups")
req.offset=0
req.size=10
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 OapiAttendanceGetsimplegroupsRequest;
$req->setOffset("0");
$req->setSize("10");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/getsimplegroups");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/getsimplegroups");
OapiAttendanceGetsimplegroupsRequest req = new OapiAttendanceGetsimplegroupsRequest();
req.Offset = 0L;
req.Size = 10L;
OapiAttendanceGetsimplegroupsResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| request_id | String | 8pi2725sgame | The request ID. |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| result | AtGroupListForTopVo | The returned result. | |
| has_more | Boolean | true | Used for pagination. Indicates whether more data exists. - true: Yes - false: No |
| groups | AtGroupForTopVo[] | The list of attendance groups. | |
| group_id | Number | 20015047 | The attendance group ID. |
| is_default | Boolean | false | Indicates whether this is the default attendance group. - false: No - true: Yes |
| group_name | String | Fixed scheduling | The attendance group name. |
| selected_class | AtClassVo[] | The list of shifts for the attendance group. | |
| enable_emp_select_class | Boolean | true | Indicates whether employees can select a shift to clock in when no scheduling is set. - true: Allowed - false: Not allowed |
| disable_check_without_schedule | Boolean | false | Indicates whether employees are prohibited from clocking in when no scheduling is set. - true: Prohibited - false: Not prohibited |
| disable_check_when_rest | Boolean | true | Indicates whether clock-in on rest days requires approval. - true: Required - false: Not required |
| setting | ClassSettingVo | The shift settings of the attendance group. | |
| class_setting_id | Number | 1 | The shift setting ID of the attendance group. |
| rest_begin_time | AtTimeVo | The break start time. Available only for shifts with a single time period. | |
| check_time | Date | 2017-04-11 11:11:11 | The start time. |
| permit_late_minutes | Number | 10 | The allowed late arrival duration, in minutes. A value of -1 indicates that this feature is disabled. |
| work_time_minutes | Number | -1 | The working duration, in minutes. A value of -1 indicates that this feature is disabled. |
| rest_end_time | AtTimeVo | The break end time. Available only for shifts with a single time period. | |
| check_time | Date | 2017-04-11 11:11:11 | The end time. |
| absenteeism_late_minutes | Number | 30 | The late arrival duration counted as absenteeism, in minutes. A value of -1 indicates that this feature is disabled. |
| serious_late_minutes | Number | 20 | The serious late arrival duration, in minutes. A value of -1 indicates that this feature is disabled. |
| is_off_duty_free_check | String | Y | Indicates whether clock-out is mandatory. - Y: Clock-out is not mandatory - N: Clock-out is mandatory |
| class_id | Number | 20008010 | The shift ID. |
| sections | AtSectionVo[] | The clock-in time periods of the shift. | |
| times | SetionTimeVO[] | The list of time periods. | |
| check_time | Date | 2017-04-11 11:11:11 | The clock-in time. |
| check_type | String | OnDuty | The clock-in type. - OnDuty: Clock-in - OffDuty: Clock-out |
| across | Number | 0 | The clock-in time span. |
| class_name | String | A | The shift name. |
| type | String | FIXED | The attendance type. - FIXED: Fixed scheduling - TURN: Rotating scheduling - NONE: No shift |
| member_count | Number | 1 | The number of attendance members. |
| default_class_id | Number | 111 | The default shift ID. |
| work_day_list | String[] | [“0”,“12”,“12”,“12”,“12”,“12”,“0”] | The workday shifts of a fixed shift. Note - 0 indicates a rest day. - The values in the array, from left to right, represent the scheduling for each day from Sunday to Saturday. |
| classes_list | String[] | [“Mon, Tue, Wed, Thu, Fri Day shift 09:00-16:00 ”,“Sat, Sun Rest”] | The weekly shift schedule display list. |
| manager_list | String[] | [“manager4220”] | The sub-administrators of the attendance group. |
| dept_name_list | String[] | [“Marketing”] | The names of the departments in the attendance group. |
| owner_user_id | String | user456 | The primary owner of the attendance group. |
Response Body Example
{
"errcode": 0,
"result": {
"groups": [
{
"group_id": 677765054,
"group_name": "Weekend Overtime",
"is_default": false,
"owner_user_id": "user456",
"manager_list": [
"manager4220"
],
"member_count": 0,
"selected_class": [],
"enable_emp_select_class": true,
"disable_check_without_schedule": false,
"disable_check_when_rest": true,
"type": "NONE",
"work_day_list": [
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
},
{
"classes_list": [
"Mon, Tue, Wed, Thu A 09:30-18:30 ",
"Fri B 19:00-05:00 (next day) ",
"Sat, Sun Rest"
],
"default_class_id": 677995086,
"dept_name_list": [
"Marketing",
"Technical Support",
"Documentation"
],
"group_id": 685935028,
"group_name": "Attendance",
"is_default": false,
"manager_list": [
"manager4220"
],
"member_count": 3,
"selected_class": [
{
"class_id": 677995086,
"class_name": "A",
"sections": [
{
"times": [
{
"across": 0,
"check_time": "1970-01-01 09:30:00",
"check_type": "OnDuty"
},
{
"across": 0,
"check_time": "1970-01-01 18:30:00",
"check_type": "OffDuty"
}
]
}
],
"setting": {
"absenteeism_late_minutes": -1,
"class_setting_id": 588655171,
"is_off_duty_free_check": "N",
"permit_late_minutes": -1,
"serious_late_minutes": -1,
"work_time_minutes": 540
}
},
{
"class_id": 678215070,
"class_name": "B",
"sections": [
{
"times": [
{
"across": 0,
"check_time": "1970-01-01 19:00:00",
"check_type": "OnDuty"
},
{
"across": 1,
"check_time": "1970-01-01 05:00:00",
"check_type": "OffDuty"
}
]
}
],
"setting": {
"absenteeism_late_minutes": -1,
"class_setting_id": 586985140,
"is_off_duty_free_check": "N",
"permit_late_minutes": 0,
"serious_late_minutes": -1,
"work_time_minutes": 600
}
}
],
"type": "FIXED",
"work_day_list": [
"0",
"677995086",
"677995086",
"677995086",
"677995086",
"678215070",
"0"
],
"enable_emp_select_class": true,
"disable_check_without_schedule": false,
"disable_check_when_rest": true
}
],
"has_more": false
},
"request_id": "8pi2725sgame"
}