Añadir canales a una integración Slack
PUT
https://api.datadoghq.com/api/v1/integration/slackhttps://api.us3.datadoghq.com/api/v1/integration/slackhttps://api.us5.datadoghq.com/api/v1/integration/slackhttps://api.datadoghq.eu/api/v1/integration/slackhttps://api.ap1.datadoghq.com/api/v1/integration/slackhttps://api.ap2.datadoghq.com/api/v1/integration/slackhttps://api.uk1.datadoghq.com/api/v1/integration/slackhttps://api.ddog-gov.com/api/v1/integration/slackhttps://api.us2.ddog-gov.com/api/v1/integration/slackDescripción general
Añade canales a tu integración Slack en Datadog actual.
Este método actualiza la configuración de tu integración sustituyendo tu configuración actual por la nueva, enviada a tu organización Datadog.
Solicitud
Body Data (required)
Actualiza el cuerpo de una solicitud de integración Slack en Datadog existente.
Campo
Type
Descripción
channels[object]
Configuración de tus canales de Slack.
account [required]string
Account to which the channel belongs to.
channel_name [required]string
Your channel name.
transfer_all_user_commentsboolean
To be notified for every comment on a graph, set it to true.
If set to False use the @slack-channel_name syntax for comments
to be posted to slack.
false{
"channels": [
{
"account": "jane.doe",
"channel_name": "#general",
"transfer_all_user_comments": false
}
]
}Respuesta
OK
Bad Request
Error response object.
Campo
Type
Descripción
errors [required][string]
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Authentication error
Error response object.
Campo
Type
Descripción
errors [required][string]
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Too many requests
Error response object.
Campo
Type
Descripción
errors [required][string]
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Ejemplo de código
Añadir canales a una integración Slack
# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF# 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 PUT "https://api.${DD_SITE}/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"channels": [
{
"account": "Main_Account",
"channel_name": "#channel_name_main_account",
"transfer_all_user_comments": false
}
]
}
EOF