Webhook インテグレーション
Dash が新機能を発表!インシデントマネジメント、Continuous Profiler など多数の機能が追加されました! Dash イベントで発表された新機能!

Webhook インテグレーション

Datadog-Webhooks インテグレーションの構成は、Datadog API から直接行います。 Datadog-Webhooks インテグレーションの詳細については、インテグレーションページを参照してください。

カスタム変数を作成する

POST https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables

概要

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

リクエスト

Body Data (required)

カスタム変数のリクエスト本文を定義します。

Expand All

フィールド

種類

説明

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

応答

OK

Custom variable for Webhook integration.

Expand All

フィールド

種類

説明

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Curl command
curl -X POST "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}
EOF

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

POST https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks

概要

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

リクエスト

Body Data (required)

Webhooks インテグレーションのリクエスト本文を作成します。

Expand All

フィールド

種類

説明

custom_headers

object

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

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. 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

object

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.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

応答

OK

Datadog-Webhooks integration.

Expand All

フィールド

種類

説明

custom_headers

object

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

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. 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

object

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.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Curl command
curl -X POST "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
  "name": "WEBHOOK_NAME",
  "url": "https://example.com/webhook"
}
EOF

カスタム変数を削除する

DELETE https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

概要

<CUSTOM_VARIABLE_NAME> という名のエンドポイントを削除します。

引数

パスパラメーター

名前

種類

説明

custom_variable_name [required]

string

The name of the custom variable.

応答

OK

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Path parameters
export custom_variable_name="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/${custom_variable_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

Webhook を削除する

DELETE https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

概要

<WEBHOOK 名> という名前のエンドポイントを削除します。

引数

パスパラメーター

名前

種類

説明

webhook_name [required]

string

The name of the webhook.

応答

OK

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Path parameters
export webhook_name="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/${webhook_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

カスタム変数を取得する

GET https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

概要

<CUSTOM_VARIABLE_NAME> という名のカスタム変数の内容を表示します。

カスタム変数がシークレットである場合は、応答ペイロードの<CUSTOM_VARIABLE_VALUE>null を返します。

引数

パスパラメーター

名前

種類

説明

custom_variable_name [required]

string

The name of the custom variable.

応答

OK

Custom variable for Webhook integration.

Expand All

フィールド

種類

説明

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Path parameters
export custom_variable_name="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/${custom_variable_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

Webhook インテグレーションを取得する

GET https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

概要

<WEBHOOK_名> という名前の Webhook のコンテンツを取得します。

引数

パスパラメーター

名前

種類

説明

webhook_name [required]

string

The name of the webhook.

応答

OK

Datadog-Webhooks integration.

Expand All

フィールド

種類

説明

custom_headers

object

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

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. 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

object

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.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Path parameters
export webhook_name="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/${webhook_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

カスタム変数を更新する

PUT https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

概要

<CUSTOM_VARIABLE_NAME> という名のエンドポイントを更新します。

引数

パスパラメーター

名前

種類

説明

custom_variable_name [required]

string

The name of the custom variable.

リクエスト

Body Data (required)

既存カスタム変数のリクエスト本文を更新します。

Expand All

フィールド

種類

説明

is_secret

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value

string

Value of the custom variable.

{
  "is_secret": false,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

応答

OK

Custom variable for Webhook integration.

Expand All

フィールド

種類

説明

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, it returns null for the <CUSTOM_VARIABLE_VALUE> in the response payload.

name [required]

string

The name of the webhook. It corresponds with <CUSTOM_VARIABLE_NAME>.

value [required]

string

Value of the custom variable.

{
  "is_secret": true,
  "name": "CUSTOM_VARIABLE_NAME",
  "value": "CUSTOM_VARIABLE_VALUE"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Path parameters
export custom_variable_name="CHANGE_ME"
# Curl command curl -X PUT "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/${custom_variable_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF {} EOF

Webhook を更新する

PUT https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

概要

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

引数

パスパラメーター

名前

種類

説明

webhook_name [required]

string

The name of the webhook.

リクエスト

Body Data (required)

既存の Datadog-Webhooks インテグレーションを更新します。

Expand All

フィールド

種類

説明

custom_headers

object

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

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. Allowed enum values: json,form

name

string

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

payload

object

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

string

URL of the webhook.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

応答

OK

Datadog-Webhooks integration.

Expand All

フィールド

種類

説明

custom_headers

object

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

<any-key>

string

Additional properties for custom headers.

encode_as

enum

Encoding type. Can be given either json or form. 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

object

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.

{
  "custom_headers": {
    "<any-key>": "string"
  },
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": {},
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Item Not Found

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

コード例


                                        # Path parameters
export webhook_name="CHANGE_ME"
# Curl command curl -X PUT "https://api.datadoghq.com"https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/${webhook_name}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \ -d @- << EOF {} EOF