DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// Create a custom variable returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.WebhooksIntegrationApi;importcom.datadog.api.client.v1.model.WebhooksIntegrationCustomVariable;importcom.datadog.api.client.v1.model.WebhooksIntegrationCustomVariableResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));WebhooksIntegrationApiapiInstance=newWebhooksIntegrationApi(defaultClient);WebhooksIntegrationCustomVariablebody=newWebhooksIntegrationCustomVariable().isSecret(true).name("EXAMPLEWEBHOOKSINTEGRATION").value("CUSTOM_VARIABLE_VALUE");try{WebhooksIntegrationCustomVariableResponseresult=apiInstance.createWebhooksIntegrationCustomVariable(body);System.out.println(result);}catch(ApiExceptione){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();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
"""
Create a custom variable returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.webhooks_integration_apiimportWebhooksIntegrationApifromdatadog_api_client.v1.model.webhooks_integration_custom_variableimportWebhooksIntegrationCustomVariablebody=WebhooksIntegrationCustomVariable(is_secret=True,name="EXAMPLEWEBHOOKSINTEGRATION",value="CUSTOM_VARIABLE_VALUE",)configuration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]withApiClient(configuration)asapi_client:api_instance=WebhooksIntegrationApi(api_client)response=api_instance.create_webhooks_integration_custom_variable(body=body)print(response)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# Create a custom variable returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]endapi_instance=DatadogAPIClient::V1::WebhooksIntegrationAPI.newbody=DatadogAPIClient::V1::WebhooksIntegrationCustomVariable.new({is_secret:true,name:"EXAMPLEWEBHOOKSINTEGRATION",value:"CUSTOM_VARIABLE_VALUE",})papi_instance.create_webhooks_integration_custom_variable(body)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// Create a custom variable returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI;usedatadog_api_client::datadogV1::model::WebhooksIntegrationCustomVariable;#[tokio::main]asyncfnmain(){letbody=WebhooksIntegrationCustomVariable::new(true,"EXAMPLEWEBHOOKSINTEGRATION".to_string(),"CUSTOM_VARIABLE_VALUE".to_string(),);letconfiguration=datadog::Configuration::new();letapi=WebhooksIntegrationAPI::with_config(configuration);letresp=api.create_webhooks_integration_custom_variable(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create a custom variable returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});constapiInstance=newv1.WebhooksIntegrationApi(configuration);constparams: v1.WebhooksIntegrationApiCreateWebhooksIntegrationCustomVariableRequest={body:{isSecret: true,name:"EXAMPLEWEBHOOKSINTEGRATION",value:"CUSTOM_VARIABLE_VALUE",},};apiInstance.createWebhooksIntegrationCustomVariable(params).then((data: v1.WebhooksIntegrationCustomVariableResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.