Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/groups/keytoid |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | qyapi_attendance_group_read (Attendance group read permission) |
Query Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | bE74xxxx | The App credential used to call this API. - Internal app: Obtain it by calling the Get the access_token of an Internal App API. - Third-party enterprise app: Obtain it by calling the Get the access_token of a Third-party Enterprise App API. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| op_user_id | String | Yes | user01 | The userId of the operator. |
| group_key | String | Yes | 02B1Exxxx | The attendance group ID, which is the legacy attendance group identifier. Call the Batch Get Attendance Group Details API to obtain the group_id parameter value. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/groups/keytoid" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=40bafxxxx9d3b06' \
-d 'group_key=0151E0xxxxA917E876' \
-d 'op_user_id=123'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/groups/keytoid");
OapiAttendanceGroupsKeytoidRequest req = new OapiAttendanceGroupsKeytoidRequest();
req.setOpUserId("user01");
req.setGroupKey("02B1Exxxx");
OapiAttendanceGroupsKeytoidResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceGroupsKeytoidRequest("https://api.dingtalk.io/topapi/attendance/groups/keytoid")
req.op_user_id="123"
req.group_key="0151E022xxxx917E876"
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 OapiAttendanceGroupsKeytoidRequest;
$req->setOpUserId("123");
$req->setGroupKey("0151E02xxxx17E876");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/groups/keytoid");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/groups/keytoid");
OapiAttendanceGroupsKeytoidRequest req = new OapiAttendanceGroupsKeytoidRequest();
req.OpUserId = "123";
req.GroupKey = "0151E0xxxx7E876";
OapiAttendanceGroupsKeytoidResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | Number | 685935028 | The attendance group ID. |
| success | Boolean | true | Indicates whether the request succeeded. - true: Success - false: Failed |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| request_id | String | 3yt2gu3zz0qi | The request ID. |
Response Body Example
{
"errcode":0,
"result":685935028,
"errmsg":"ok",
"success":true,
"request_id":"3yt2gu3zz0qi"
}