Link a page to an incident
https://api.datadoghq.com/api/v2/incidents/{incident_id}/pages/linkhttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/pages/linkhttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/pages/linkhttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/pages/linkhttps://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/pages/linkhttps://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/pages/linkhttps://api.uk1.datadoghq.com/api/v2/incidents/{incident_id}/pages/linkhttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/pages/linkhttps://api.us2.ddog-gov.com/api/v2/incidents/{incident_id}/pages/linkDescripción general
Link an existing on-call page to an incident.
OAuth apps require the incident_write authorization scope to access this endpoint.
Argumentos
Parámetros de ruta
incident_id [required]The UUID of the incident.
Solicitud
Body Data (required)
On-call page link payload.
data [required]On-call page data in a link request.
attributesAttributes for linking a page to an incident.
keyThe key of the on-call page.
page_targetThe target of an on-call page.
identifier [required]The identifier of the page target.
type [required]The type of the page target.
team_idThe team ID associated with the page (deprecated, use page_target instead).
id [required]The ID of the on-call page to link.
type [required]On-call page resource type.
page{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}Respuesta
Created
Response with an incident integration metadata.
data [required]Incident integration metadata from a response.
attributesIncident integration metadata's attributes for a create request.
createdTimestamp when the incident todo was created.
incident_idUUID of the incident this integration metadata is connected to.
integration_type [required]A number indicating the type of integration this metadata is for. 1 indicates Slack; 7 indicates Microsoft Teams; 8 indicates Jira.
metadata [required]Incident integration metadata's metadata attribute.
Object 1Incident integration metadata for the Slack integration.
channels [required]Array of Slack channels in this integration metadata.
channel_id [required]Slack channel ID.
channel_name [required]Name of the Slack channel.
redirect_url [required]URL redirecting to the Slack channel.
team_idSlack team ID.
Object 2Incident integration metadata for the Jira integration.
issues [required]Array of Jira issues in this integration metadata.
account [required]URL of issue's Jira account.
issue_keyJira issue's issue key.
issuetype_idJira issue's issue type.
project_key [required]Jira issue's project keys.
redirect_urlURL redirecting to the Jira issue.
Object 3Incident integration metadata for the Microsoft Teams integration.
teams [required]Array of Microsoft Teams in this integration metadata.
ms_channel_id [required]Microsoft Teams channel ID.
ms_channel_name [required]Microsoft Teams channel name.
ms_tenant_id [required]Microsoft Teams tenant ID.
redirect_url [required]URL redirecting to the Microsoft Teams channel.
modifiedTimestamp when the incident todo was last modified.
statusA number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.
id [required]The incident integration metadata's ID.
relationshipsThe incident's integration relationships from a response.
created_by_userRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersuserslast_modified_by_userRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersuserstype [required]Integration metadata resource type.
incident_integrationsincident_integrationsincludedIncluded related resources that the user requested.
<type=users>User object returned by the API.
attributesAttributes of user object returned by the API.
created_atThe ISO 8601 timestamp of when the user account was created.
disabledWhether the user account is deactivated. Disabled users cannot log in.
emailThe email address of the user, used for login and notifications.
handleThe unique handle (username) of the user, typically matching their email prefix.
iconURL of the user's profile icon, typically a Gravatar URL derived from the email address.
last_login_timeThe ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in.
mfa_enabledWhether multi-factor authentication (MFA) is enabled for the user's account.
modified_atThe ISO 8601 timestamp of when the user account was last modified.
nameThe full display name of the user as shown in the Datadog UI.
service_accountWhether this is a service account rather than a human user. Service accounts are used for programmatic API access.
statusThe current status of the user account (for example, Active, Pending, or Disabled).
titleThe job title of the user (for example, "Senior Engineer" or "Product Manager").
uuidThe globally unique identifier (UUID) of the user.
verifiedWhether the user's email address has been verified.
idID of the user.
relationshipsRelationships of the user object returned by the API.
orgRelationship to an organization.
data [required]Relationship to organization object.
id [required]ID of the organization.
type [required]Organizations resource type.
orgsorgsother_orgsRelationship to organizations.
data [required]Relationships to organization objects.
id [required]ID of the organization.
type [required]Organizations resource type.
orgsorgsother_usersRelationship to users.
data [required]Relationships to user objects.
id [required]A unique identifier that represents the user.
type [required]Users resource type.
usersusersrolesRelationship to roles.
dataAn array containing type and the unique identifier of a role.
idThe unique identifier of the role.
typeRoles type.
rolesrolestypeUsers resource type.
usersusers{
"data": {
"attributes": {
"created": "2019-09-19T10:00:00.000Z",
"incident_id": "00000000-aaaa-0000-0000-000000000000",
"integration_type": 1,
"metadata": {
"channels": [
{
"channel_id": "C0123456789",
"channel_name": "#example-channel-name",
"redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
"team_id": "T01234567"
}
]
},
"modified": "2019-09-19T10:00:00.000Z",
"status": "integer"
},
"id": "00000000-0000-0000-1234-000000000000",
"relationships": {
"created_by_user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
},
"last_modified_by_user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "incident_integrations"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"last_login_time": "2019-09-19T10:00:00.000Z",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"uuid": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Conflict - page already linked to incident.
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Ejemplo de código
# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF# Path parameters
export incident_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/incidents/${incident_id}/pages/link" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"key": "PAGE-12345",
"page_target": {
"identifier": "my-oncall-team",
"type": "team_handle"
}
},
"id": "PAGE-12345",
"type": "page"
}
}
EOF