VBScript / Datadog API Collection / Remove a Slack integration channel
Back to Collection Items
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Http")
set http = CreateObject("Chilkat.Http")
http.SetRequestHeader "Accept","application/json"
' resp is a Chilkat.HttpResponse
Set resp = http.QuickRequest("DELETE","https://api.app.ddog-gov.com/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name")
If (http.LastMethodSuccess = 0) Then
outFile.WriteLine(http.LastErrorText)
WScript.Quit
End If
respStatusCode = resp.StatusCode
outFile.WriteLine("Response Status Code = " & respStatusCode)
If (respStatusCode <> 204) Then
outFile.WriteLine("Response Header:")
outFile.WriteLine(resp.Header)
outFile.WriteLine("Response Body:")
outFile.WriteLine(resp.BodyStr)
outFile.WriteLine("Failed.")
WScript.Quit
End If
outFile.WriteLine("Success.")
outFile.Close
Curl Command
curl -X DELETE
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name
Postman Collection Item JSON
{
"name": "Remove a Slack integration channel",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"integration",
"slack",
"configuration",
"accounts",
":account_name",
"channels",
":channel_name"
],
"variable": [
{
"key": "account_name",
"value": "tempor Ut sed velit"
},
{
"key": "channel_name",
"value": "tempor Ut sed velit"
}
]
},
"description": "Remove a channel from your Datadog-Slack integration."
},
"response": [
{
"name": "The channel was removed successfully.",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"integration",
"slack",
"configuration",
"accounts",
":account_name",
"channels",
":channel_name"
],
"variable": [
{
"key": "account_name"
},
{
"key": "channel_name"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
},
{
"name": "Bad Request",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"integration",
"slack",
"configuration",
"accounts",
":account_name",
"channels",
":channel_name"
],
"variable": [
{
"key": "account_name"
},
{
"key": "channel_name"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"Bad Request\",\n \"Bad Request\"\n ]\n}"
},
{
"name": "Authentication error",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"integration",
"slack",
"configuration",
"accounts",
":account_name",
"channels",
":channel_name"
],
"variable": [
{
"key": "account_name"
},
{
"key": "channel_name"
}
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"Bad Request\",\n \"Bad Request\"\n ]\n}"
},
{
"name": "Item Not Found",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"integration",
"slack",
"configuration",
"accounts",
":account_name",
"channels",
":channel_name"
],
"variable": [
{
"key": "account_name"
},
{
"key": "channel_name"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"Bad Request\",\n \"Bad Request\"\n ]\n}"
},
{
"name": "Too many requests",
"originalRequest": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/integration/slack/configuration/accounts/:account_name/channels/:channel_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"integration",
"slack",
"configuration",
"accounts",
":account_name",
"channels",
":channel_name"
],
"variable": [
{
"key": "account_name"
},
{
"key": "channel_name"
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"Bad Request\",\n \"Bad Request\"\n ]\n}"
}
]
}