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

# 業務通知の送信取消

> 送信から24時間以内の業務通知を取消し、社内アプリの誤送信に対応します

本 API を呼び出すと、業務通知を送信取消できます。社内アプリで誤送信した業務通知を取り消す必要があるシーンに適しています。

## API 呼び出し説明

本 API では、送信から 24 時間以内の業務通知のみ送信取消できます。

## 権限

サーバー API はアプリ単位で権限が付与されます。アプリ作成時に、システムによりメッセージ通知権限がデフォルトで追加されています。

| アプリタイプ       | 呼び出し可否 | 権限申請方法        | API Explorer デバッグ                                                                                                 |
| ------------ | ------ | ------------- | ----------------------------------------------------------------------------------------------------------------- |
| 社内アプリ        | 対応     | デフォルトで有効、申請不要 | [デバッグ](https://open-dev.dingtalk.io/apiExplorer#/?devType=org\&api=dingtalk.oapi.message.corpconversation.recall) |
| サードパーティ社内アプリ | 対応     | デフォルトで有効、申請不要 | [デバッグ](https://open-dev.dingtalk.io/apiExplorer#/?devType=isv\&api=dingtalk.oapi.message.corpconversation.recall) |
| サードパーティ個人アプリ | 未対応    | —             | —                                                                                                                 |

## 基本情報

**HTTP メソッド**：POST

**リクエスト URL**：

## リクエスト

| **基本情報**     |                                                                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| HTTP URL     | [https://api.dingtalk.io/topapi/message/corpconversation/recall](https://api.dingtalk.io/topapi/message/corpconversation/recall) |
| HTTP Method  | POST                                                                                                                             |
| サポートするアプリタイプ | appType-社内アプリappType-サードパーティ社内アプリ                                                                                                |
| 権限要件         | permission-qyapi\_base-企業 API 呼び出し時に必要な基本権限                                                                                      |

### クエリパラメータ

| 名前            | タイプ    | 必須 | 例        | 説明                                                                                                                                                                              |
| ------------- | ------ | -- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| access\_token | String | 必須 | bE74xxxx | 本 API を呼び出すためのアプリ認証情報。   - 社内アプリの場合、[社内アプリの access\_token 取得](/ja/open/development/obtain-orgapp-token) API より取得します。 - サードパーティ社内アプリの場合、サードパーティ企業の access\_token 取得 API より取得します。 |

### リクエストボディ

| 名前            | タイプ    | 必須 | 例            | 説明                                                                                                                                                                                           |
| ------------- | ------ | -- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agent\_id     | Number | 必須 | 836390886    | チャット送信時に使用するマイクロアプリの AgentId。   - 社内アプリの場合、[開発者管理画面](https://open-dev.dingtalk.io/#/appMgr/inner/h5/836390886/1)のアプリ詳細ページで確認できます。image - サードパーティ社内アプリの場合、企業の権限付与情報取得 API を呼び出して取得します。        |
| msg\_task\_id | Number | 必須 | 256271667526 | チャット送信時に DingTalk から返却されるタスク ID。[業務通知の送信](/ja/open/development/asynchronous-sending-of-enterprise-session-messages) API を呼び出して task\_id パラメータの値を取得します。  **説明**  送信から 24 時間以内の業務通知のみ送信取消できます。 |

### リクエスト例

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/message/corpconversation/recall" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=404080xxxx4ab30' \
-d 'agent_id=1000' \
-d 'msg_task_id=2000'
```

Java

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/message/corpconversation/recall");
OapiMessageCorpconversationRecallRequest req = new OapiMessageCorpconversationRecallRequest();
req.setAgentId(1000L);
req.setMsgTaskId(2000L);
OapiMessageCorpconversationRecallResponse rsp = client.execute(req, accessToken);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiMessageCorpconversationRecallRequest("https://api.dingtalk.io/topapi/message/corpconversation/recall")

req.agent_id=1000
req.msg_task_id=2000
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 OapiMessageCorpconversationRecallRequest;
$req->setAgentId("1000");
$req->setMsgTaskId("2000");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/message/corpconversation/recall");
```

C#

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/message/corpconversation/recall");
OapiMessageCorpconversationRecallRequest req = new OapiMessageCorpconversationRecallRequest();
req.AgentId = 1000L;
req.MsgTaskId = 2000L;
OapiMessageCorpconversationRecallResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## レスポンス

### レスポンスボディ

| 名前      | タイプ    | 例  | 説明          |
| ------- | ------ | -- | ----------- |
| errmsg  | String | ok | リターンコードの説明。 |
| errcode | Number | 0  | リターンコード。    |

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

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

### エラーコード

本 API の呼び出しでエラーが発生した場合、[グローバルエラーコード](/ja/open/development/server-api-error-codes-1)ドキュメントでエラーメッセージから解決方法を検索できます。

| エラーコード（errorcode） | エラーメッセージ（errmsg）                      | 解決方法                             |
| ----------------- | ------------------------------------- | -------------------------------- |
| 400002            | agentId not valid or taskId not valid | agentId または taskId が正しいか確認してください |
| 500               | システムエラー                               | 不明なシステムエラーが発生しました                |
