Chilkat Online Tools

Perl / Datadog API Collection / Delete a webhook

Back to Collection Items

use chilkat();

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

$http = chilkat::CkHttp->new();

$http->SetRequestHeader("Accept","application/json");

# resp is a HttpResponse
$resp = $http->QuickRequest("DELETE","https://api.app.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/:webhook_name");
if ($http->get_LastMethodSuccess() == 0) {
    print $http->lastErrorText() . "\r\n";
    exit;
}

print $resp->get_StatusCode() . "\r\n";
print $resp->bodyStr() . "\r\n";

Curl Command

curl -X DELETE
	-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/integration/webhooks/configuration/webhooks/:webhook_name

Postman Collection Item JSON

{
  "name": "Delete a webhook",
  "request": {
    "method": "DELETE",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v1/integration/webhooks/configuration/webhooks/:webhook_name",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "integration",
        "webhooks",
        "configuration",
        "webhooks",
        ":webhook_name"
      ],
      "variable": [
        {
          "key": "webhook_name",
          "value": "tempor Ut sed velit"
        }
      ]
    },
    "description": "Deletes the endpoint with the name `<WEBHOOK NAME>`."
  },
  "response": [
    {
      "name": "OK",
      "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/webhooks/configuration/webhooks/:webhook_name",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "integration",
            "webhooks",
            "configuration",
            "webhooks",
            ":webhook_name"
          ],
          "variable": [
            {
              "key": "webhook_name"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "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/webhooks/configuration/webhooks/:webhook_name",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "integration",
            "webhooks",
            "configuration",
            "webhooks",
            ":webhook_name"
          ],
          "variable": [
            {
              "key": "webhook_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/webhooks/configuration/webhooks/:webhook_name",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "integration",
            "webhooks",
            "configuration",
            "webhooks",
            ":webhook_name"
          ],
          "variable": [
            {
              "key": "webhook_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/webhooks/configuration/webhooks/:webhook_name",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "integration",
            "webhooks",
            "configuration",
            "webhooks",
            ":webhook_name"
          ],
          "variable": [
            {
              "key": "webhook_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}"
    }
  ]
}