For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ja/api/latest/webhooks-integration/create-a-webhooks-integration.md. A documentation index is available at /llms.txt.
Language
Datadog site

Webhooks インテグレーションを作成する

POSThttps://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.us5.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhookshttps://api.ap1.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.ap2.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.uk1.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhookshttps://api.us2.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks

概要

<WEBHOOK_NAME> という名前のエンドポイントを作成します。

This endpoint requires the create_webhooks permission.

OAuth apps require the create_webhooks authorization scope to access this endpoint.

リクエスト

Body Data (required)

Webhooks インテグレーションリクエストボディを作成します。

フィールド
タイプ
説明
custom_headers
string

Datadog-Webhooks インテグレーション。

encode_as
enum

Encoding type. Can be given either json or form.

Default: json
Allowed enum values: json, form
name [required]
string

The name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in monitor notifications.

payload
string

If null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. Webhooks variable usage.

url [required]
string

URL of the webhook.

応答

OK

Datadog-Webhooks integration.

フィールド
タイプ
説明
custom_headers
string

If null, uses no header. If given a JSON payload, these will be headers attached to your webhook.

encode_as
enum

Encoding type. Can be given either json or form.

Default: json
Allowed enum values: json, form
name [required]
string

The name of the webhook. It corresponds with <WEBHOOK_NAME>. Learn more on how to use it in monitor notifications.

payload
string

If null, uses the default payload. If given a JSON payload, the webhook returns the payload specified by the given payload. Webhooks variable usage.

url [required]
string

URL of the webhook.

コード例

Create a webhooks integration returns "OK" response
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/integration/webhooks/configuration/webhooks" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "name": "Example-Webhooks-Integration",
  "url": "https://example.com/webhook"
}
EOF