> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 休暇ルールの削除

> leave_code で指定した休暇ルールを削除する API です。OA承認権限を持つ管理者のユーザー ID を渡し、不要な休暇ルールを削除します。

この API を呼び出して、指定した休暇ルールを削除します。

## リクエスト

| **基本情報** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/vacation/type/delete](https://api.dingtalk.io/topapi/attendance/vacation/type/delete) |
| HTTP メソッド | POST |
| 対応アプリタイプ | appType-社内アプリ　appType-サードパーティ社内アプリ |
| 必要な権限 | qyapi\_holiday\_manage：DingTalk 休暇管理権限 |

### クエリパラメータ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| access\_token | String | はい | bE74xxxx | この API の呼び出しに使用するアプリ認証情報です。   - 社内アプリの場合は、[社内アプリの access\_token を取得](https://help.dingtalk.io/ja/open/development/obtain-orgapp-token)を呼び出して取得します。 - サードパーティ社内アプリの場合は、サードパーティ組織の access\_token を取得する API を呼び出して取得します。 |

### リクエストボディ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| leave\_code | String | はい | 03747xxxx | 休暇ルールの一意の識別子です。[休暇ルール一覧の照会](https://help.dingtalk.io/ja/open/development/holiday-type-query.md)を呼び出して leave\_code の値を取得します。 |
| op\_userid | String | はい | user01 | **OA承認**のアプリ権限を持つ、社内の管理者のユーザー ID です。 |

### リクエスト例

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
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'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
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());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
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)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
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");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
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);
```

## レスポンス

### レスポンスボディ

| 名前 | タイプ | 例 | 説明 |
| - | - | - | - |
| result | LeaveTypeVo | | 返却結果です。 |
| leave\_code | String | 03747xxxx | 休暇ルールの一意の識別子です。 |
| leave\_name | String | 年次有給休暇 | 休暇の名前です。 |
| leave\_view\_unit | String | day | 休暇申請の単位です。   - **day**：日 - **halfDay**：半日 - **hour**：時間 |
| biz\_type | String | general\_leave | 休暇タイプです。   - **general\_leave**：通常の休暇 - **lieu\_leave**：残業を代休に振り替えた休暇 |
| natural\_day\_leave | Boolean | true | 暦日で休暇時間を計算するかどうかを示します。   - **true**：暦日で休暇時間を計算します。 - **false**：暦日で休暇時間を計算しません。  **注意**  値が **false** の場合、ユーザーが休暇申請を提出する際に、休暇期間中のユーザーのシフト設定に基づいて休暇時間を計算します。 |
| hours\_in\_per\_day | Number | 1000 | 1日あたりの労働時間です（単位：1/100 時間）。  例：1日 = 10時間 = 1000。 |
| errcode | Number | 0 | 戻りコードです。 |
| errmsg | String | ok | 戻りコードの説明です。 |
| success | Boolean | true | 呼び出しに成功したかどうかを示します。   - **true**：はい - **false**：いいえ |
| request\_id | String | xss3trk3zypq | リクエスト ID です。 |

### レスポンスボディの例

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "errmsg":"ok",
  "result": {
    "biz_type": "general_leave",
    "hours_in_per_day": 1000,
    "leave_code": "03747xxxx",
    "leave_name": "年次有給休暇",
    "leave_view_unit": "day",
    "natural_day_leave": true
  },
  "success": true,
  "request_id": "xss3trk3zypq"
}
```

### エラーコード

呼び出しでエラーが返された場合は、エラーメッセージをもとに[グローバルエラーコード](https://help.dingtalk.io/ja/open/development/server-api-error-codes-1.md)ドキュメントで解決方法を確認してください。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.