> ## 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.

# 承認取り消しの通知

> 承認済みの承認フォームをユーザー ID と承認 ID で取り消し、関連する勤怠記録も元に戻す API です。残業・休暇・外出・出張・打刻修正に対応します。

この API を呼び出して、承認の取り消しを通知します。残業、休暇申請、外出、出張、打刻修正のタイプに対応しています。

## API 呼び出し説明

[承認完了の通知](https://help.dingtalk.io/ja/open/development/api-processapprovefinish.md) API を呼び出した後に、送信済みの承認フォームを取り消す必要が生じる場合があります。その場合は、この API を呼び出して、変更された勤怠記録を元に戻します。

## リクエスト

| **ベーシック情報** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/approve/cancel](https://api.dingtalk.io/topapi/attendance/approve/cancel) |
| HTTP メソッド | POST |
| 対応アプリタイプ | appType-社内アプリ　appType-サードパーティ社内アプリ |
| 権限 | permission-qyapi\_attendance\_group\_manage-勤怠グループ管理権限 |

### クエリパラメータ

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

### リクエストボディ

| 名前 | タイプ | 必須 | 例 | 説明 |
| - | - | - | - | - |
| userid | String | はい | manager4220 | 社員のユーザー ID です。 |
| approve\_id | String | はい | 2376620852 | 承認 ID です。[承認完了の通知](https://help.dingtalk.io/ja/open/development/api-processapprovefinish.md) API のカスタムパラメータ approve\_id の値を使用します。 |

### リクエスト例

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/approve/cancel" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=95676xxxxdee' \
-d 'approve_id=1234abcd' \
-d 'userid=dd_dd'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/approve/cancel");
OapiAttendanceApproveCancelRequest req = new OapiAttendanceApproveCancelRequest();
req.setUserid("manager4220");
req.setApproveId("2376620852");
OapiAttendanceApproveCancelResponse 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.OapiAttendanceApproveCancelRequest("https://api.dingtalk.io/topapi/attendance/approve/cancel")

req.userid="dd_dd"
req.approve_id="1234abcd"
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 OapiAttendanceApproveCancelRequest;
$req->setUserid("dd_dd");
$req->setApproveId("1234abcd");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/approve/cancel");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/approve/cancel");
OapiAttendanceApproveCancelRequest req = new OapiAttendanceApproveCancelRequest();
req.Userid = "dd_dd";
req.ApproveId = "1234abcd";
OapiAttendanceApproveCancelResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## レスポンス

### レスポンスボディ

| 名前 | タイプ | 例 | 説明 |
| - | - | - | - |
| errcode | Number | 0 | 戻りコードです。 |
| errmsg | String | ok | 戻りコードの説明です。 |

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

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode":0,
  "errmsg":"ok"
}
```

### エラーコード

この API がエラーを返した場合は、エラーメッセージをもとに[グローバルエラーコード](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.