Skip to content

Latest commit

 

History

History
342 lines (245 loc) · 12.3 KB

SlackIntegrationApi.md

File metadata and controls

342 lines (245 loc) · 12.3 KB

datadog-api-client.v1.SlackIntegrationApi

All URIs are relative to https://api.datadoghq.com

Method HTTP request Description
createSlackIntegrationChannel POST /api/v1/integration/slack/configuration/accounts/{account_name}/channels Create a Slack integration channel
getSlackIntegrationChannel GET /api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name} Get a Slack integration channel
getSlackIntegrationChannels GET /api/v1/integration/slack/configuration/accounts/{account_name}/channels Get all channels in a Slack integration
removeSlackIntegrationChannel DELETE /api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name} Remove a Slack integration channel
updateSlackIntegrationChannel PATCH /api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name} Update a Slack integration channel

createSlackIntegrationChannel

SlackIntegrationChannel createSlackIntegrationChannel(body)

Add a channel to your Datadog-Slack integration.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

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

let params: v1.SlackIntegrationApiCreateSlackIntegrationChannelRequest = {
  // string | Your Slack account name.
  accountName: "account_name_example",
  // SlackIntegrationChannel | Payload describing Slack channel to be created
  body: {
    display: {
      message: true,
      notified: true,
      snapshot: true,
      tags: true,
    },
    name: "#general",
  },
};

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

Parameters

Name Type Description Notes
body SlackIntegrationChannel Payload describing Slack channel to be created
accountName [string] Your Slack account name. defaults to undefined

Return type

SlackIntegrationChannel

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Item Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSlackIntegrationChannel

SlackIntegrationChannel getSlackIntegrationChannel()

Get a channel configured for your Datadog-Slack integration.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

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

let params: v1.SlackIntegrationApiGetSlackIntegrationChannelRequest = {
  // string | Your Slack account name.
  accountName: "account_name_example",
  // string | The name of the Slack channel being operated on.
  channelName: "channel_name_example",
};

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

Parameters

Name Type Description Notes
accountName [string] Your Slack account name. defaults to undefined
channelName [string] The name of the Slack channel being operated on. defaults to undefined

Return type

SlackIntegrationChannel

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Item Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSlackIntegrationChannels

Array getSlackIntegrationChannels()

Get a list of all channels configured for your Datadog-Slack integration.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

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

let params: v1.SlackIntegrationApiGetSlackIntegrationChannelsRequest = {
  // string | Your Slack account name.
  accountName: "account_name_example",
};

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

Parameters

Name Type Description Notes
accountName [string] Your Slack account name. defaults to undefined

Return type

Array

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Item Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

removeSlackIntegrationChannel

void removeSlackIntegrationChannel()

Remove a channel from your Datadog-Slack integration.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

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

let params: v1.SlackIntegrationApiRemoveSlackIntegrationChannelRequest = {
  // string | Your Slack account name.
  accountName: "account_name_example",
  // string | The name of the Slack channel being operated on.
  channelName: "channel_name_example",
};

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

Parameters

Name Type Description Notes
accountName [string] Your Slack account name. defaults to undefined
channelName [string] The name of the Slack channel being operated on. defaults to undefined

Return type

void

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 The channel was removed successfully. -
400 Bad Request -
403 Authentication error -
404 Item Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateSlackIntegrationChannel

SlackIntegrationChannel updateSlackIntegrationChannel(body)

Update a channel used in your Datadog-Slack integration.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

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

let params: v1.SlackIntegrationApiUpdateSlackIntegrationChannelRequest = {
  // string | Your Slack account name.
  accountName: "account_name_example",
  // string | The name of the Slack channel being operated on.
  channelName: "channel_name_example",
  // SlackIntegrationChannel | Payload describing fields and values to be updated.
  body: {
    display: {
      message: true,
      notified: true,
      snapshot: true,
      tags: true,
    },
    name: "#general",
  },
};

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

Parameters

Name Type Description Notes
body SlackIntegrationChannel Payload describing fields and values to be updated.
accountName [string] Your Slack account name. defaults to undefined
channelName [string] The name of the Slack channel being operated on. defaults to undefined

Return type

SlackIntegrationChannel

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Item Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]