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

# 業務通知ステータスバーの更新

> OA業務通知のステータスバーをリアルタイムで更新して承認状況を表示します

本 API を呼び出して、OA 業務通知チャットのステータスを更新します。

## API 呼び出し説明

* 本 API は OA 業務通知タイプに適用され、承認ステータスをリアルタイムで更新するシーンで利用します。
* 本 API では、7 日以内に送信された業務通知のステータスバーのみ更新できます。

## リクエスト

| **基本情報**     |                                                                                                                                                         |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HTTP URL     | [https://api.dingtalk.io/topapi/message/corpconversation/status\_bar/update](https://api.dingtalk.io/topapi/message/corpconversation/status_bar/update) |
| 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 | はい  | 123        | チャット送信時に使用するマイクロアプリの AgentId。   - 社内アプリの場合は、[開発者バックエンド](https://open-dev.dingtalk.io/#/appMgr/inner/h5/836390886/1)のアプリ詳細ページで確認できます。 - サードパーティ社内アプリの場合は、企業の権限付与情報を取得する API を呼び出して取得します。 |
| task\_id      | Number | はい  | 11         | 業務通知タスクの ID。[業務通知の送信](/ja/open/development/asynchronous-sending-of-enterprise-session-messages) API を呼び出して task\_id パラメータの値を取得します。                                                      |
| status\_value | String | はい  | 承認済み       | ステータスバーの値。                                                                                                                                                                              |
| status\_bg    | String | いいえ | 0xFF78C06E | ステータスバーの背景色。0xFF + 6 桁のカラー値で指定することを推奨します。                                                                                                                                               |

### リクエスト例

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/message/corpconversation/status_bar/update" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=e4bbxxxxe7683' \
-d 'agent_id=123' \
-d 'status_bg=0xFFF65E5E' \
-d 'status_value=%E5%AE%8C%E4%BA%86%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F' \
-d 'task_id=1111'
```

Java

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/message/corpconversation/status_bar/update");
OapiMessageCorpconversationStatusBarUpdateRequest req = new OapiMessageCorpconversationStatusBarUpdateRequest();
req.setAgentId(123L);
req.setTaskId(1111L);
req.setStatusValue("完了しました");
req.setStatusBg("0xFFF65E5E");
OapiMessageCorpconversationStatusBarUpdateResponse 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.OapiMessageCorpconversationStatusBarUpdateRequest("https://api.dingtalk.io/topapi/message/corpconversation/status_bar/update")

req.agent_id=123
req.task_id=1111
req.status_value="完了しました"
req.status_bg="0xFFF65E5E"
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 OapiMessageCorpconversationStatusBarUpdateRequest;
$req->setAgentId("123");
$req->setTaskId("1111");
$req->setStatusValue("完了しました");
$req->setStatusBg("0xFFF65E5E");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/message/corpconversation/status_bar/update");
```

C#

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/message/corpconversation/status_bar/update");
OapiMessageCorpconversationStatusBarUpdateRequest req = new OapiMessageCorpconversationStatusBarUpdateRequest();
req.AgentId = 123L;
req.TaskId = 1111L;
req.StatusValue = "完了しました";
req.StatusBg = "0xFFF65E5E";
OapiMessageCorpconversationStatusBarUpdateResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## レスポンス

### レスポンスボディ

| 名前          | タイプ    | 例            | 説明          |
| ----------- | ------ | ------------ | ----------- |
| request\_id | String | 4jzllmte0wau | リクエスト ID。   |
| errmsg      | String | ok           | リターンコードの説明。 |
| errcode     | Number | 0            | リターンコード。    |

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

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

### エラーコード

API 呼び出しでエラーが発生した場合は、エラーメッセージをもとに[グローバルエラーコード](/ja/open/development/server-api-error-codes-1)ドキュメントで解決方法を検索してください。

| エラーコード（errorcode） | エラーメッセージ（errmsg）             | 解決方法                                                                                 |
| ----------------- | ---------------------------- | ------------------------------------------------------------------------------------ |
| 40056             | 不正な agentid                  | agentId が正しいか確認してください。                                                               |
| 40035             | 不正なパラメータ                     | taskId が正しいか確認してください。                                                                |
| 41052             | 今回の送信対象者が多すぎるため、送信結果は返却されません | - 業務通知の送信対象メンバー数を減らしてください。 - 業務通知チャットの送信進捗が完了しているか確認してください。進捗が完了していない場合、このエラーが発生します。 |
| 500               | システムエラー                      | 不明なシステムエラーが発生しました。                                                                   |
