# Slack Webhook

### Slackのセットアップ

Webhook機能を使用すると、以下の手順でSlackチャンネルにカスタムアラートとアクションを送信できます。

<figure><img src="/files/Woh9ZUY9qp5pldHYsfnr" alt=""><figcaption><p>Slackの通知例</p></figcaption></figure>

1. <https://api.slack.com/appsに移動して、アプリを新規作成します。>

<figure><img src="/files/s3LjIXC0ZDAhZ64Ax0Tc" alt=""><figcaption><p>アプリを新規作成</p></figcaption></figure>

2. アプリに名前を付け、目的のワークスペースを選択し&#x3066;**\[Create App]** (アプリを作成) をクリックします。

<figure><img src="/files/4smv1HVbkH8y3P3MI00g" alt=""><figcaption><p>アプリを作成</p></figcaption></figure>

3. **\[Incoming Webhooks]** (着信Webhooks) をクリックします。

<figure><img src="/files/CrFgOH6DRytz89AXSOZ7" alt=""><figcaption></figcaption></figure>

4. Webhookを有効にして、**\[Add New Webhook to Workspace]** (新しいWebhookをワークスペースに追加) をクリックします。

<figure><img src="/files/XZjJvICkPQnqBRP4CsDE" alt=""><figcaption><p>Webhookを有効化</p></figcaption></figure>

5. アラートを送信するSlackチャンネルを選択します。\[Copy] (コピー) をクリックして、管理コンソールに接続するために必要なWebhookのURLを取得します。

<figure><img src="/files/3W3Ui4XlnsvXgmrLB4OZ" alt=""><figcaption><p>WebhookのURLをコピー</p></figcaption></figure>

6. 左側の\[Basic Information] (基本情報) セクションで、Keeperアイコンを追加できます。画像を右クリックして保存します。以下のリンクを使用して、Keeperの512 x 512 PNGアイコンをダウンロードします。\
   \
   <https://keeper-email-images.s3.amazonaws.com/common/Keeper_512x512.png>

<figure><img src="/files/mkc4LxfL18xUG5kE2QuO" alt=""><figcaption></figcaption></figure>

7. **Keeper管理コンソール**にログインし、**\[レポートとアラート]** > **\[アラート]**&#x306B;アクセスして、アラートを新規作成します。目的のイベントタイプと属性を選択しt絵から、**\[受信者を追加]**&#x3092;クリックします。 以下の例では、すべてのポリシー変更関連イベントが選択されています。

<figure><img src="/files/9O4kJdJC7S4DCWMGo2Of" alt=""><figcaption><p>アラートを追加</p></figcaption></figure>

<figure><img src="/files/SXaxZZ9sVuqG6FJGoYfw" alt=""><figcaption><p>イベントタイプと属性を選択</p></figcaption></figure>

<figure><img src="/files/1fNQbNn6z3Z1KKo2qajc" alt=""><figcaption></figcaption></figure>

8. イベント受信者の名前とメールアドレスを入力し、**\[Webhookを追加]**&#x3092;クリックします。

<figure><img src="/files/6cjCFxzbeon3wMcPkAiY" alt=""><figcaption><p>Webhookを追加</p></figcaption></figure>

9. 手順5のWebhook URLを貼り付けます。

<figure><img src="/files/LYisH7zhI1dvUHecmrAG" alt=""><figcaption></figcaption></figure>

10. 以下のJSONコンテンツ&#x3092;**\[HTTPボディ]**&#x306E;フィールドに貼り付けます。

```
{
  "text":"Keeper Security Event",
  "blocks": [
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Alert Name*\n#alert_name"
        }
      ]
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Event Details*\n#description"
        }
      ]
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*IP Address*\n#remote_address"
        },
        {
          "type": "mrkdwn",
          "text": "*Timestamp*\n#timestamp"
        }
      ]
    },
    {
      "type": "actions",
      "elements": [
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text":"Vault Login",
            "emoji": true
          },
          "value": "vault",
          "url": "https://keepersecurity.com/vault",
          "action_id": "actionId-1"
        },
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text":"Console Login",
            "emoji": true
          },
          "value": "console",
          "url": "https://keepersecurity.com/console",
          "action_id": "actionId-2"
        }
      ]
    }
  ]
}

```

<figure><img src="/files/2xjZbnrobJqzI2XOcUWf" alt=""><figcaption><p>HTTPボディ</p></figcaption></figure>

10. **\[保存]**&#x3092;クリックしてアラートを保存します。

<figure><img src="/files/HVvhvlHbWAV4lkVWiNUw" alt=""><figcaption><p>アラート保存</p></figcaption></figure>

<figure><img src="/files/LCrXnvnrS8KQiyAvSHo0" alt=""><figcaption><p>保存を追加</p></figcaption></figure>

以上です。 イベントの送信が開始するまでに最大15分かかる場合があります。HTTPボディは、任意で変更できます。カスタマイズについてはSlackの[Block Kit Builder](https://api.slack.com/block-kit)をご参照ください。

{% hint style="info" %}
新しいWebhookボディコンテンツの作成とコンテンツの編集が有効になるまでに最大15分かかる場合があります。
{% endhint %}

### 共有レコードの通知

特定の共有フォルダにレコードが追加された際に通知を送信するのにも使用できます。

<figure><img src="/files/GvDMISzO4hpOCwJN6LWF" alt=""><figcaption><p>共有記録の通知例</p></figcaption></figure>

1. 上記のSlackの設定手順に従って、基本のSlack統合を作成します。
2. ウェブボルトで、対象の共有フォルダのUIDを取得します。

<figure><img src="/files/w5oqJzJMiMgneIddo05F" alt=""><figcaption><p>共有フォルダのUID</p></figcaption></figure>

3. 管理コンソールで、「共有フォルダへレコードを追加」のイベントを追跡する新しいアラートを作成します。

<figure><img src="/files/QF8OiRB8DneIua0Rqhzx" alt=""><figcaption></figcaption></figure>

4. 属性セクションで、共有フォルダのUIDを貼り付けます。

<figure><img src="/files/m7x3MrbZUVAihK0IGCuw" alt=""><figcaption><p>共有フォルダUIDを追加</p></figcaption></figure>

5. **\[受信者を追加]**&#x3092;クリックし、新しいWebhookの受信者を作成します。

<figure><img src="/files/CLdPoxCUIF7LvCoJhwxH" alt=""><figcaption></figcaption></figure>

6. 以下のJSONコードをHTTPボディのフィールドに貼り付けます。作成しているアラートに合わせて、「text」フィールドを編集してください。

```
{
  "text":"Keeper - Added Record to Shared Folder",
  "blocks": [
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Alert Name*\n#alert_name"
        }
      ]
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Event Details*\n#description"
        }
      ]
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*IP Address*\n#remote_address"
        },
        {
          "type": "mrkdwn",
          "text": "*Timestamp*\n#timestamp"
        },
        {
          "type": "mrkdwn",
          "text": "*Record UID*\n#record_uid"
        }
      ]
    },
    {
      "type": "actions",
      "elements": [
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text":"Open Record",
            "emoji": true
          },
          "value": "vault",
          "url": "https://keepersecurity.com/vault#detail/#record_uid",
          "action_id": "actionId-1"
        },
        {
          "type": "button",
          "text": {
            "type": "plain_text",
            "text":"Console Login",
            "emoji": true
          },
          "value": "console",
          "url": "https://keepersecurity.com/console",
          "action_id": "actionId-2"
        }
      ]
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/enterprise-guide/jp/webhooks/slack-webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
