Create On-Call Page
https://navy.oncall.datadoghq.com/api/v2/on-call/pageshttps://teal.oncall.datadoghq.com/api/v2/on-call/pageshttps://coral.oncall.datadoghq.com/api/v2/on-call/pageshttps://beige.oncall.datadoghq.eu/api/v2/on-call/pageshttps://saffron.oncall.datadoghq.com/api/v2/on-call/pageshttps://lava.oncall.datadoghq.com/api/v2/on-call/pageshttps://scarlet.oncall.datadoghq.com/api/v2/on-call/pageshttps://navy.oncall.datadoghq.com/api/v2/on-call/pageshttps://navy.oncall.datadoghq.com/api/v2/on-call/pagesOverview
Trigger a new On-Call Page.
Request
Body Data (required)
dataThe main request body, including attributes and resource type.
attributesDetails about the On-Call Page you want to create.
descriptionA short summary of the issue or context.
tagsTags to help categorize or filter the page.
target [required]Information about the target to notify (such as a team or user).
identifierIdentifier for the target (for example, team handle or user ID).
typeThe kind of target, team_id | team_handle | user_id.
team_id, team_handle, user_idtitle [required]The title of the page.
urgency [required]On-Call Page urgency level.
highlow, hightype [required]The type of resource used when creating an On-Call Page.
pagespages{
"data": {
"attributes": {
"description": "string",
"tags": [],
"target": {
"identifier": "string",
"type": "team_id"
},
"title": "Service: Test is down",
"urgency": "high"
},
"type": "pages"
}
}Response
OK.
The full response object after creating a new On-Call Page.
dataThe information returned after successfully creating a page.
idThe unique ID of the created page.
type [required]The type of resource used when creating an On-Call Page.
pagespages{
"data": {
"id": "15e74b8b-f865-48d0-bcc5-453323ed2c8f",
"type": "pages"
}
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://navy.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://teal.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://coral.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://beige.oncall.datadoghq.eu/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://saffron.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://lava.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://scarlet.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://navy.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF# Set your Datadog credentials
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://navy.oncall.datadoghq.com/api/v2/on-call/pages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"description": "Page details.",
"tags": [
"service:test"
],
"target": {
"identifier": "my-team",
"type": "team_handle"
},
"title": "Page title",
"urgency": "low"
},
"type": "pages"
}
}
EOF// Create On-Call Page returns "OK." response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.CreatePageRequest{
Data: &datadogV2.CreatePageRequestData{
Attributes: &datadogV2.CreatePageRequestDataAttributes{
Description: datadog.PtrString("Page details."),
Tags: []string{
"service:test",
},
Target: datadogV2.CreatePageRequestDataAttributesTarget{
Identifier: datadog.PtrString("my-team"),
Type: datadogV2.ONCALLPAGETARGETTYPE_TEAM_HANDLE.Ptr(),
},
Title: "Page title",
Urgency: datadogV2.PAGEURGENCY_LOW,
},
Type: datadogV2.CREATEPAGEREQUESTDATATYPE_PAGES,
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewOnCallPagingApi(apiClient)
resp, r, err := api.CreateOnCallPage(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OnCallPagingApi.CreateOnCallPage`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `OnCallPagingApi.CreateOnCallPage`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Create On-Call Page returns "OK." response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.OnCallPagingApi;
import com.datadog.api.client.v2.model.CreatePageRequest;
import com.datadog.api.client.v2.model.CreatePageRequestData;
import com.datadog.api.client.v2.model.CreatePageRequestDataAttributes;
import com.datadog.api.client.v2.model.CreatePageRequestDataAttributesTarget;
import com.datadog.api.client.v2.model.CreatePageRequestDataType;
import com.datadog.api.client.v2.model.CreatePageResponse;
import com.datadog.api.client.v2.model.OnCallPageTargetType;
import com.datadog.api.client.v2.model.PageUrgency;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
OnCallPagingApi apiInstance = new OnCallPagingApi(defaultClient);
CreatePageRequest body =
new CreatePageRequest()
.data(
new CreatePageRequestData()
.attributes(
new CreatePageRequestDataAttributes()
.description("Page details.")
.tags(Collections.singletonList("service:test"))
.target(
new CreatePageRequestDataAttributesTarget()
.identifier("my-team")
.type(OnCallPageTargetType.TEAM_HANDLE))
.title("Page title")
.urgency(PageUrgency.LOW))
.type(CreatePageRequestDataType.PAGES));
try {
CreatePageResponse result = apiInstance.createOnCallPage(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling OnCallPagingApi#createOnCallPage");
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:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Create On-Call Page returns "OK." response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.on_call_paging_api import OnCallPagingApi
from datadog_api_client.v2.model.create_page_request import CreatePageRequest
from datadog_api_client.v2.model.create_page_request_data import CreatePageRequestData
from datadog_api_client.v2.model.create_page_request_data_attributes import CreatePageRequestDataAttributes
from datadog_api_client.v2.model.create_page_request_data_attributes_target import CreatePageRequestDataAttributesTarget
from datadog_api_client.v2.model.create_page_request_data_type import CreatePageRequestDataType
from datadog_api_client.v2.model.on_call_page_target_type import OnCallPageTargetType
from datadog_api_client.v2.model.page_urgency import PageUrgency
body = CreatePageRequest(
data=CreatePageRequestData(
attributes=CreatePageRequestDataAttributes(
description="Page details.",
tags=[
"service:test",
],
target=CreatePageRequestDataAttributesTarget(
identifier="my-team",
type=OnCallPageTargetType.TEAM_HANDLE,
),
title="Page title",
urgency=PageUrgency.LOW,
),
type=CreatePageRequestDataType.PAGES,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = OnCallPagingApi(api_client)
response = api_instance.create_on_call_page(body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Create On-Call Page returns "OK." response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::OnCallPagingAPI.new
body = DatadogAPIClient::V2::CreatePageRequest.new({
data: DatadogAPIClient::V2::CreatePageRequestData.new({
attributes: DatadogAPIClient::V2::CreatePageRequestDataAttributes.new({
description: "Page details.",
tags: [
"service:test",
],
target: DatadogAPIClient::V2::CreatePageRequestDataAttributesTarget.new({
identifier: "my-team",
type: DatadogAPIClient::V2::OnCallPageTargetType::TEAM_HANDLE,
}),
title: "Page title",
urgency: DatadogAPIClient::V2::PageUrgency::LOW,
}),
type: DatadogAPIClient::V2::CreatePageRequestDataType::PAGES,
}),
})
p api_instance.create_on_call_page(body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Create On-Call Page returns "OK." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_on_call_paging::OnCallPagingAPI;
use datadog_api_client::datadogV2::model::CreatePageRequest;
use datadog_api_client::datadogV2::model::CreatePageRequestData;
use datadog_api_client::datadogV2::model::CreatePageRequestDataAttributes;
use datadog_api_client::datadogV2::model::CreatePageRequestDataAttributesTarget;
use datadog_api_client::datadogV2::model::CreatePageRequestDataType;
use datadog_api_client::datadogV2::model::OnCallPageTargetType;
use datadog_api_client::datadogV2::model::PageUrgency;
#[tokio::main]
async fn main() {
let body = CreatePageRequest::new().data(
CreatePageRequestData::new(CreatePageRequestDataType::PAGES).attributes(
CreatePageRequestDataAttributes::new(
CreatePageRequestDataAttributesTarget::new()
.identifier("my-team".to_string())
.type_(OnCallPageTargetType::TEAM_HANDLE),
"Page title".to_string(),
PageUrgency::LOW,
)
.description("Page details.".to_string())
.tags(vec!["service:test".to_string()]),
),
);
let configuration = datadog::Configuration::new();
let api = OnCallPagingAPI::with_config(configuration);
let resp = api.create_on_call_page(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Create On-Call Page returns "OK." response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.OnCallPagingApi(configuration);
const params: v2.OnCallPagingApiCreateOnCallPageRequest = {
body: {
data: {
attributes: {
description: "Page details.",
tags: ["service:test"],
target: {
identifier: "my-team",
type: "team_handle",
},
title: "Page title",
urgency: "low",
},
type: "pages",
},
},
};
apiInstance
.createOnCallPage(params)
.then((data: v2.CreatePageResponse) => {
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:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"