Intégration Webhooks

Intégration Webhooks

Configurez votre intégration Datadog/Webhooks directement via l’API Datadog. Pour en savoir plus sur l’intégration Datadog/Webhooks, consultez la page dédiée à l’intégration.

POST https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhookshttps://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhookshttps://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhookshttps://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks

Présentation

Crée un endpoint <NOM_WEBHOOK>.

Requête

Body Data (required)

Corps de requête pour la création d’une intégration Webhooks.

Expand All

Champ

Type

Description

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

{
  "custom_headers": "string",
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": "string",
  "url": "https://example.com/webhook"
}

Réponse

OK

Datadog-Webhooks integration.

Expand All

Champ

Type

Description

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

{
  "custom_headers": "string",
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": "string",
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewWebhooksIntegration("WEBHOOK_NAME", "https://example.com/webhook") // WebhooksIntegration | Create a webhooks integration request body.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksIntegrationApi.CreateWebhooksIntegration(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.CreateWebhooksIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateWebhooksIntegration`: WebhooksIntegration
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from WebhooksIntegrationApi.CreateWebhooksIntegration:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    body = WebhooksIntegration(
        custom_headers="custom_headers_example",
        encode_as=WebhooksIntegrationEncoding("json"),
        name="WEBHOOK_NAME",
        payload="payload_example",
        url="https://example.com/webhook",
    )  # WebhooksIntegration | Create a webhooks integration request body.

    # example passing only required values which don't have defaults set
    try:
        # Create a webhooks integration
        api_response = api_instance.create_webhooks_integration(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->create_webhooks_integration: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
body = DatadogAPIClient::V1::WebhooksIntegration.new({name: 'WEBHOOK_NAME', url: 'https://example.com/webhook'}) # WebhooksIntegration | Create a webhooks integration request body.

begin
  # Create a webhooks integration
  result = api_instance.create_webhooks_integration(body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->create_webhooks_integration: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiCreateWebhooksIntegrationRequest = {
  // WebhooksIntegration | Create a webhooks integration request body.
  body: {
    customHeaders: "customHeaders_example",
    encodeAs: "json",
    name: "WEBHOOK_NAME",
    payload: "payload_example",
    url: "https://example.com/webhook",
  },
};

apiInstance
  .createWebhooksIntegration(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        WebhooksIntegration body = new WebhooksIntegration(); // WebhooksIntegration | Create a webhooks integration request body.
        try {
            WebhooksIntegration result = apiInstance.createWebhooksIntegration(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#createWebhooksIntegration");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

GET https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

Présentation

Récupère le contenu du Webhook <NOM_WEBHOOK>.

Arguments

Paramètres du chemin

Nom

Type

Description

webhook_name [required]

string

The name of the webhook.

Réponse

OK

Datadog-Webhooks integration.

Expand All

Champ

Type

Description

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

{
  "custom_headers": "string",
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": "string",
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    webhookName := "webhookName_example" // string | The name of the webhook.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksIntegrationApi.GetWebhooksIntegration(ctx, webhookName)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.GetWebhooksIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetWebhooksIntegration`: WebhooksIntegration
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from WebhooksIntegrationApi.GetWebhooksIntegration:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    webhook_name = "webhook_name_example"  # str | The name of the webhook.

    # example passing only required values which don't have defaults set
    try:
        # Get a webhook integration
        api_response = api_instance.get_webhooks_integration(webhook_name)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->get_webhooks_integration: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
webhook_name = 'webhook_name_example' # String | The name of the webhook.

begin
  # Get a webhook integration
  result = api_instance.get_webhooks_integration(webhook_name)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->get_webhooks_integration: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiGetWebhooksIntegrationRequest = {
  // string | The name of the webhook.
  webhookName: "webhook_name_example",
};

apiInstance
  .getWebhooksIntegration(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        String webhookName = "webhookName_example"; // String | The name of the webhook.
        try {
            WebhooksIntegration result = apiInstance.getWebhooksIntegration(webhookName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#getWebhooksIntegration");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

PUT https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

Présentation

Met à jour l’endpoint <NOM_WEBHOOK>.

Arguments

Paramètres du chemin

Nom

Type

Description

webhook_name [required]

string

The name of the webhook.

Requête

Body Data (required)

Mettez à jour une intégration Datadog/Webhooks existante.

Expand All

Champ

Type

Description

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

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

string

URL of the webhook.

{
  "custom_headers": "string",
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": "string",
  "url": "https://example.com/webhook"
}

Réponse

OK

Datadog-Webhooks integration.

Expand All

Champ

Type

Description

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

{
  "custom_headers": "string",
  "encode_as": "string",
  "name": "WEBHOOK_NAME",
  "payload": "string",
  "url": "https://example.com/webhook"
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    webhookName := "webhookName_example" // string | The name of the webhook.
    body := *datadog.NewWebhooksIntegrationUpdateRequest() // WebhooksIntegrationUpdateRequest | Update an existing Datadog-Webhooks integration.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksIntegrationApi.UpdateWebhooksIntegration(ctx, webhookName, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.UpdateWebhooksIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateWebhooksIntegration`: WebhooksIntegration
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from WebhooksIntegrationApi.UpdateWebhooksIntegration:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    webhook_name = "webhook_name_example"  # str | The name of the webhook.
    body = WebhooksIntegrationUpdateRequest(
        custom_headers="custom_headers_example",
        encode_as=WebhooksIntegrationEncoding("json"),
        name="WEBHOOK_NAME",
        payload="payload_example",
        url="https://example.com/webhook",
    )  # WebhooksIntegrationUpdateRequest | Update an existing Datadog-Webhooks integration.

    # example passing only required values which don't have defaults set
    try:
        # Update a webhook
        api_response = api_instance.update_webhooks_integration(webhook_name, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->update_webhooks_integration: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
webhook_name = 'webhook_name_example' # String | The name of the webhook.
body = DatadogAPIClient::V1::WebhooksIntegrationUpdateRequest.new # WebhooksIntegrationUpdateRequest | Update an existing Datadog-Webhooks integration.

begin
  # Update a webhook
  result = api_instance.update_webhooks_integration(webhook_name, body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->update_webhooks_integration: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiUpdateWebhooksIntegrationRequest = {
  // string | The name of the webhook.
  webhookName: "webhook_name_example",
  // WebhooksIntegrationUpdateRequest | Update an existing Datadog-Webhooks integration.
  body: {
    customHeaders: "customHeaders_example",
    encodeAs: "json",
    name: "WEBHOOK_NAME",
    payload: "payload_example",
    url: "https://example.com/webhook",
  },
};

apiInstance
  .updateWebhooksIntegration(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        String webhookName = "webhookName_example"; // String | The name of the webhook.
        WebhooksIntegrationUpdateRequest body = new WebhooksIntegrationUpdateRequest(); // WebhooksIntegrationUpdateRequest | Update an existing Datadog-Webhooks integration.
        try {
            WebhooksIntegration result = apiInstance.updateWebhooksIntegration(webhookName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#updateWebhooksIntegration");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

DELETE https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}

Présentation

Supprime l’endpoint <NOM_WEBHOOK>.

Arguments

Paramètres du chemin

Nom

Type

Description

webhook_name [required]

string

The name of the webhook.

Réponse

OK

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    webhookName := "webhookName_example" // string | The name of the webhook.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    r, err := apiClient.WebhooksIntegrationApi.DeleteWebhooksIntegration(ctx, webhookName)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.DeleteWebhooksIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    webhook_name = "webhook_name_example"  # str | The name of the webhook.

    # example passing only required values which don't have defaults set
    try:
        # Delete a webhook
        api_instance.delete_webhooks_integration(webhook_name)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->delete_webhooks_integration: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
webhook_name = 'webhook_name_example' # String | The name of the webhook.

begin
  # Delete a webhook
  api_instance.delete_webhooks_integration(webhook_name)
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->delete_webhooks_integration: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiDeleteWebhooksIntegrationRequest = {
  // string | The name of the webhook.
  webhookName: "webhook_name_example",
};

apiInstance
  .deleteWebhooksIntegration(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        String webhookName = "webhookName_example"; // String | The name of the webhook.
        try {
            apiInstance.deleteWebhooksIntegration(webhookName);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#deleteWebhooksIntegration");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

POST https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variableshttps://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variableshttps://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variableshttps://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables

Présentation

Crée un endpoint avec le nom <NOM_VARIABLE_PERSONNALISÉE>.

Requête

Body Data (required)

Corps de requête pour la définition d’une variable personnalisée.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, the value is not returned in the response payload.

name [required]

string

The name of the variable. 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"
}

Réponse

OK

Custom variable for Webhook integration.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, the value is not returned in the response payload.

name [required]

string

The name of the variable. It corresponds with <CUSTOM_VARIABLE_NAME>. It must only contains upper-case characters, integers or underscores.

value

string

Value of the custom variable. It won't be returned if the variable is secret.

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

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewWebhooksIntegrationCustomVariable(true, "CUSTOM_VARIABLE_NAME", "CUSTOM_VARIABLE_VALUE") // WebhooksIntegrationCustomVariable | Define a custom variable request body.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksIntegrationApi.CreateWebhooksIntegrationCustomVariable(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.CreateWebhooksIntegrationCustomVariable`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateWebhooksIntegrationCustomVariable`: WebhooksIntegrationCustomVariableResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from WebhooksIntegrationApi.CreateWebhooksIntegrationCustomVariable:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    body = WebhooksIntegrationCustomVariable(
        is_secret=True,
        name="CUSTOM_VARIABLE_NAME",
        value="CUSTOM_VARIABLE_VALUE",
    )  # WebhooksIntegrationCustomVariable | Define a custom variable request body.

    # example passing only required values which don't have defaults set
    try:
        # Create a custom variable
        api_response = api_instance.create_webhooks_integration_custom_variable(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->create_webhooks_integration_custom_variable: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
body = DatadogAPIClient::V1::WebhooksIntegrationCustomVariable.new({is_secret: true, name: 'CUSTOM_VARIABLE_NAME', value: 'CUSTOM_VARIABLE_VALUE'}) # WebhooksIntegrationCustomVariable | Define a custom variable request body.

begin
  # Create a custom variable
  result = api_instance.create_webhooks_integration_custom_variable(body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->create_webhooks_integration_custom_variable: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiCreateWebhooksIntegrationCustomVariableRequest =
  {
    // WebhooksIntegrationCustomVariable | Define a custom variable request body.
    body: {
      isSecret: true,
      name: "CUSTOM_VARIABLE_NAME",
      value: "CUSTOM_VARIABLE_VALUE",
    },
  };

apiInstance
  .createWebhooksIntegrationCustomVariable(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        WebhooksIntegrationCustomVariable body = new WebhooksIntegrationCustomVariable(); // WebhooksIntegrationCustomVariable | Define a custom variable request body.
        try {
            WebhooksIntegrationCustomVariableResponse result = apiInstance.createWebhooksIntegrationCustomVariable(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#createWebhooksIntegrationCustomVariable");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

GET https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

Présentation

Affiche le contenu de la variable personnalisée <NOM_VARIABLE_PERSONNALISÉE>. Si la variable personnalisée est secrète, renvoie null pour <NOM_VARIABLE_PERSONNALISÉE> dans la charge utile de la réponse.

Arguments

Paramètres du chemin

Nom

Type

Description

custom_variable_name [required]

string

The name of the custom variable.

Réponse

OK

Custom variable for Webhook integration.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, the value is not returned in the response payload.

name [required]

string

The name of the variable. It corresponds with <CUSTOM_VARIABLE_NAME>. It must only contains upper-case characters, integers or underscores.

value

string

Value of the custom variable. It won't be returned if the variable is secret.

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

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    customVariableName := "customVariableName_example" // string | The name of the custom variable.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksIntegrationApi.GetWebhooksIntegrationCustomVariable(ctx, customVariableName)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.GetWebhooksIntegrationCustomVariable`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetWebhooksIntegrationCustomVariable`: WebhooksIntegrationCustomVariableResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from WebhooksIntegrationApi.GetWebhooksIntegrationCustomVariable:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    custom_variable_name = "custom_variable_name_example"  # str | The name of the custom variable.

    # example passing only required values which don't have defaults set
    try:
        # Get a custom variable
        api_response = api_instance.get_webhooks_integration_custom_variable(custom_variable_name)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->get_webhooks_integration_custom_variable: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
custom_variable_name = 'custom_variable_name_example' # String | The name of the custom variable.

begin
  # Get a custom variable
  result = api_instance.get_webhooks_integration_custom_variable(custom_variable_name)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->get_webhooks_integration_custom_variable: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiGetWebhooksIntegrationCustomVariableRequest =
  {
    // string | The name of the custom variable.
    customVariableName: "custom_variable_name_example",
  };

apiInstance
  .getWebhooksIntegrationCustomVariable(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        String customVariableName = "customVariableName_example"; // String | The name of the custom variable.
        try {
            WebhooksIntegrationCustomVariableResponse result = apiInstance.getWebhooksIntegrationCustomVariable(customVariableName);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#getWebhooksIntegrationCustomVariable");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

PUT https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

Présentation

Met à jour l’endpoint <CUSTOM_VARIABLE_NAME>.

Arguments

Paramètres du chemin

Nom

Type

Description

custom_variable_name [required]

string

The name of the custom variable.

Requête

Body Data (required)

Corps de requête pour la mise à jour d’une variable personnalisée existante.

Expand All

Champ

Type

Description

is_secret

boolean

Make custom variable is secret or not. If the custom variable is secret, the value is not returned in the response payload.

name

string

The name of the variable. It corresponds with <CUSTOM_VARIABLE_NAME>. It must only contains upper-case characters, integers or underscores.

value

string

Value of the custom variable.

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

Réponse

OK

Custom variable for Webhook integration.

Expand All

Champ

Type

Description

is_secret [required]

boolean

Make custom variable is secret or not. If the custom variable is secret, the value is not returned in the response payload.

name [required]

string

The name of the variable. It corresponds with <CUSTOM_VARIABLE_NAME>. It must only contains upper-case characters, integers or underscores.

value

string

Value of the custom variable. It won't be returned if the variable is secret.

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

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    customVariableName := "customVariableName_example" // string | The name of the custom variable.
    body := *datadog.NewWebhooksIntegrationCustomVariableUpdateRequest() // WebhooksIntegrationCustomVariableUpdateRequest | Update an existing custom variable request body.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksIntegrationApi.UpdateWebhooksIntegrationCustomVariable(ctx, customVariableName, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.UpdateWebhooksIntegrationCustomVariable`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateWebhooksIntegrationCustomVariable`: WebhooksIntegrationCustomVariableResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from WebhooksIntegrationApi.UpdateWebhooksIntegrationCustomVariable:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    custom_variable_name = "custom_variable_name_example"  # str | The name of the custom variable.
    body = WebhooksIntegrationCustomVariableUpdateRequest(
        is_secret=True,
        name="CUSTOM_VARIABLE_NAME",
        value="CUSTOM_VARIABLE_VALUE",
    )  # WebhooksIntegrationCustomVariableUpdateRequest | Update an existing custom variable request body.

    # example passing only required values which don't have defaults set
    try:
        # Update a custom variable
        api_response = api_instance.update_webhooks_integration_custom_variable(custom_variable_name, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->update_webhooks_integration_custom_variable: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
custom_variable_name = 'custom_variable_name_example' # String | The name of the custom variable.
body = DatadogAPIClient::V1::WebhooksIntegrationCustomVariableUpdateRequest.new # WebhooksIntegrationCustomVariableUpdateRequest | Update an existing custom variable request body.

begin
  # Update a custom variable
  result = api_instance.update_webhooks_integration_custom_variable(custom_variable_name, body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->update_webhooks_integration_custom_variable: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiUpdateWebhooksIntegrationCustomVariableRequest =
  {
    // string | The name of the custom variable.
    customVariableName: "custom_variable_name_example",
    // WebhooksIntegrationCustomVariableUpdateRequest | Update an existing custom variable request body.
    body: {
      isSecret: true,
      name: "CUSTOM_VARIABLE_NAME",
      value: "CUSTOM_VARIABLE_VALUE",
    },
  };

apiInstance
  .updateWebhooksIntegrationCustomVariable(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        String customVariableName = "customVariableName_example"; // String | The name of the custom variable.
        WebhooksIntegrationCustomVariableUpdateRequest body = new WebhooksIntegrationCustomVariableUpdateRequest(); // WebhooksIntegrationCustomVariableUpdateRequest | Update an existing custom variable request body.
        try {
            WebhooksIntegrationCustomVariableResponse result = apiInstance.updateWebhooksIntegrationCustomVariable(customVariableName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#updateWebhooksIntegrationCustomVariable");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

DELETE https://api.datadoghq.eu/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.ddog-gov.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}https://api.us3.datadoghq.com/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}

Présentation

Supprime l’endpoint <NOM_VARIABLE_PERSONNALISÉE>.

Arguments

Paramètres du chemin

Nom

Type

Description

custom_variable_name [required]

string

The name of the custom variable.

Réponse

OK

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code


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

import (
    "context"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    customVariableName := "customVariableName_example" // string | The name of the custom variable.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    r, err := apiClient.WebhooksIntegrationApi.DeleteWebhooksIntegrationCustomVariable(ctx, customVariableName)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksIntegrationApi.DeleteWebhooksIntegrationCustomVariable`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import webhooks_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = webhooks_integration_api.WebhooksIntegrationApi(api_client)
    custom_variable_name = "custom_variable_name_example"  # str | The name of the custom variable.

    # example passing only required values which don't have defaults set
    try:
        # Delete a custom variable
        api_instance.delete_webhooks_integration_custom_variable(custom_variable_name)
    except ApiException as e:
        print("Exception when calling WebhooksIntegrationApi->delete_webhooks_integration_custom_variable: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::WebhooksIntegrationAPI.new
custom_variable_name = 'custom_variable_name_example' # String | The name of the custom variable.

begin
  # Delete a custom variable
  api_instance.delete_webhooks_integration_custom_variable(custom_variable_name)
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling WebhooksIntegrationAPI->delete_webhooks_integration_custom_variable: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.WebhooksIntegrationApi(configuration);

let params: v1.WebhooksIntegrationApiDeleteWebhooksIntegrationCustomVariableRequest =
  {
    // string | The name of the custom variable.
    customVariableName: "custom_variable_name_example",
  };

apiInstance
  .deleteWebhooksIntegrationCustomVariable(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.WebhooksIntegrationApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        WebhooksIntegrationApi apiInstance = new WebhooksIntegrationApi(defaultClient);
        String customVariableName = "customVariableName_example"; // String | The name of the custom variable.
        try {
            apiInstance.deleteWebhooksIntegrationCustomVariable(customVariableName);
        } catch (ApiException e) {
            System.err.println("Exception when calling WebhooksIntegrationApi#deleteWebhooksIntegrationCustomVariable");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"