> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/advocate-program-settings/create-and-manage-advocate-webhook-subscriptions.md).

# AdvocateのWebhook購読を作成・管理する

Webhookとは、イベントが発生したときに実行されるコードです。AdvocateではWebhookを使用してURLを登録できます。プログラム内でイベントが発生するたびに、そのURLにPOSTリクエストを送信します。たとえば、新しい参加者向けのカスタムクーポンコードが作成されると、イベントオブジェクトが作成されます。Webhookの作成と管理には、次の2つの方法があります。 [Advocate APIを使用する](https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/api-webhooks-for-advocate-programs) または、Advocateプラットフォームを使用する方法です。このヘルプ記事では、AdvocateプラットフォームでWebhookを管理する方法を説明します。

#### Webhookサブスクリプションを作成する

1. 上部のナビゲーションバーで、 ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2F210dEQa93qyQgoJDkieL%2FUser%20profile.svg?alt=media\&token=f84c5b17-fae4-4a30-990a-9de5e57a150b) **\[ユーザープロフィール] → 設定**.
2. 左側の列で *Advocateの設定*を選択し、 **Webhook**.
3. 「 *Webhookサブスクリプション* ページで、選択します **サブスクリプションを作成**.
4. 下の *投稿先 URL*に、特定のイベントに関するリアルタイムの更新をアプリケーションが送信するために使用する、一意のアドレスを入力します。
5. 任意で、下の *Webhook 名*に、新しい webhook サブスクリプションの名前を入力します。
6. を選択します。 **保存**.

#### Webhook ログのトラブルシューティング

プログラムでイベントが発生するたびに Advocate が投稿する URL を登録すると、ログを確認して、失敗した webhook イベントのトラブルシューティングを行えます。

**Webhookログにアクセスする**

1. 上部のナビゲーションバーで、 ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2F210dEQa93qyQgoJDkieL%2FUser%20profile.svg?alt=media\&token=f84c5b17-fae4-4a30-990a-9de5e57a150b) **\[ユーザープロフィール] → 設定**.
2. 左側の列で *Advocateの設定*を選択し、 **Webhook**.
3. 「 *Webhook Subscriptions* 」ページで、 **「ログを表示」を選択します**.
4. 以下のフィルター「 *Webhooks Event Log* 」を使ってWebhookを絞り込みます。
   * 「 *フィルターのリファレンス* 詳細については、以下をご覧ください。

<details>

<summary>フィルターの参照</summary>

| フィルター | 説明                                                                                                                                                                         |
| ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 種類    | Webhook のフィルター [イベントタイプ](https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/api-webhooks-for-advocate-programs)。このフィルターのデフォルトは *すべてのタイプ*. |
| 期間    | Webhook が最後に更新された期間でフィルターします。このフィルターのデフォルトは *全期間*.                                                                                                                         |

</details>

**Webhook の詳細を表示**

1. 特定の Webhook を選択して、次を開きます *Webhook の詳細* ビュー。
2. このビューには、Webhook サブスクリプションのトラブルシューティングに役立つ情報が表示されます。
   * 詳しくは、以下の *イベントリファレンス* を参照してください。

<details>

<summary>イベントリファレンス</summary>

| フィルター        | 説明                                                                                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 種類           | Webhook の [イベントタイプ](https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/api-webhooks-for-advocate-programs).           |
| Webhook ID   | Webhookの一意の識別子。                                                                                                                                        |
| 作成日          | Webhookが作成された日付。                                                                                                                                       |
| イベントデータ      | Webhook [ペイロード](https://integrations.impact.com/integration-guides/for-brands/advocate/advocate-api/api-webhooks-for-advocate-programs).               |
| サブスクリプション    | Webhookの送信先となったWebhookサブスクリプションとそのステータス。                                                                                                               |
| サブスクリプションの詳細 | Webhookサブスクリプションのエンドポイントから受信したレスポンスの詳細。Webhookの配信試行に関する詳細が含まれる場合があり、試行のタイムスタンプ、宛先から受信したHTTPステータスコード、宛先サーバーからの応答に時間がかかりすぎたためにリクエストがタイムアウトしたかどうかが表示されます。 |

</details>

**イベント配信失敗時のWebhook再試行システム**

* RESTフックは、イベントがトリガーされた直後に配信されます。エンドポイントが配信試行に正常に応答しない場合（つまり、200以外のステータスコードを返した場合）、配信は失敗とみなされます。
* 配信に失敗すると、成功するまで、または72回試行するまで（1時間に1回の再試行で約3日間）、前回の失敗から1時間ごとに再試行されます。
* エラーを継続的に返すWebhookエンドポイントは、次の回数のエラーが発生すると自動的に無効になります。

  | ステータスコード | エラー受信回数 |
  | -------- | ------- |
  | 4xxエラー   | 1000    |
  | 5xxエラー   | 2000    |
  | 3xxエラー   | 2000    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/advocate-program-settings/create-and-manage-advocate-webhook-subscriptions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
