Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/vacation/type/delete |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | qyapi_holiday_manage: DingTalk leave 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 Get the access_token of an Internal App to obtain it. - For a Third-party enterprise app, call the API for getting the access_token of a third-party organization to obtain it. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| leave_code | String | Yes | 03747xxxx | The unique identifier of the leave rule. Call Query the List of Leave Rules to obtain the leave_code value. |
| op_userid | String | Yes | user01 | The user ID of an admin in your organization who has OA Approval app permissions. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/vacation/type/delete" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=3acaxxxxa30a2' \
-d 'leave_code=037477axxxxae5e7973' \
-d 'op_userid=03085665764167'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/vacation/type/delete");
OapiAttendanceVacationTypeDeleteRequest req = new OapiAttendanceVacationTypeDeleteRequest();
req.setLeaveCode("03747xxxx");
req.setOpUserid("user01");
OapiAttendanceVacationTypeDeleteResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceVacationTypeDeleteRequest("https://api.dingtalk.io/topapi/attendance/vacation/type/delete")
req.leave_code="03747xxxx7973"
req.op_userid="03085665764167"
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 OapiAttendanceVacationTypeDeleteRequest;
$req->setLeaveCode("03747xxxx7973");
$req->setOpUserid("03085665764167");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/vacation/type/delete");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/vacation/type/delete");
OapiAttendanceVacationTypeDeleteRequest req = new OapiAttendanceVacationTypeDeleteRequest();
req.LeaveCode = "0374xxxx7973";
req.OpUserid = "03085665764167";
OapiAttendanceVacationTypeDeleteResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | LeaveTypeVo | The returned result. | |
| leave_code | String | 03747xxxx | The unique identifier of the leave rule. |
| leave_name | String | Annual leave | The name of the leave. |
| leave_view_unit | String | day | The unit of the leave request. - day: Day - halfDay: Half day - hour: Hour |
| biz_type | String | general_leave | The leave type. - general_leave: Regular leave - lieu_leave: Overtime converted to compensatory leave |
| natural_day_leave | Boolean | true | Whether to calculate the leave duration by calendar day. - true: Calculate the leave duration by calendar day. - false: Do not calculate the leave duration by calendar day. Note If the value is false, the leave duration is calculated based on the user’s scheduling during the leave period when the user submits a leave request. |
| hours_in_per_day | Number | 1000 | The working hours per day, in units of 1/100 hour. For example, 1 day = 10 hours = 1000. |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| success | Boolean | true | Whether the call succeeded. - true: Yes - false: No |
| request_id | String | xss3trk3zypq | The request ID. |
Response Body Example
{
"errcode": 0,
"errmsg":"ok",
"result": {
"biz_type": "general_leave",
"hours_in_per_day": 1000,
"leave_code": "03747xxxx",
"leave_name": "Annual leave",
"leave_view_unit": "day",
"natural_day_leave": true
},
"success": true,
"request_id": "xss3trk3zypq"
}