phpExt / Datadog API Collection / Delete an application key for this service account
Back to Collection Items
<?php
include("chilkat.php");
// Use "chilkat_9_5_0.php" for versions of Chilkat < 10.0.0
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
$http = new CkHttp();
$http->SetRequestHeader('Accept','application/json');
// resp is a CkHttpResponse
$resp = $http->QuickRequest('DELETE','https://api.app.ddog-gov.com/api/v2/service_accounts/:service_account_id/application_keys/:app_key_id');
if ($http->get_LastMethodSuccess() == false) {
print $http->lastErrorText() . "\n";
exit;
}
$respStatusCode = $resp->get_StatusCode();
print 'Response Status Code = ' . $respStatusCode . "\n";
if ($respStatusCode != 204) {
print 'Response Header:' . "\n";
print $resp->header() . "\n";
print 'Response Body:' . "\n";
print $resp->bodyStr() . "\n";
print 'Failed.' . "\n";
exit;
}
print 'Success.' . "\n";
?>
Curl Command
curl -X DELETE
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v2/service_accounts/:service_account_id/application_keys/:app_key_id
Postman Collection Item JSON
{
"name": "Delete an application key for this service account",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/service_accounts/:service_account_id/application_keys/:app_key_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"service_accounts",
":service_account_id",
"application_keys",
":app_key_id"
],
"variable": [
{
"key": "service_account_id",
"value": "<string>"
},
{
"key": "app_key_id",
"value": "<string>"
}
]
},
"description": "Delete an application key owned by this service account."
},
"response": [
{
"name": "No Content",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: apikey",
"key": "DD-API-KEY",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/service_accounts/:service_account_id/application_keys/:app_key_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"service_accounts",
":service_account_id",
"application_keys",
":app_key_id"
],
"variable": [
{
"key": "service_account_id"
},
{
"key": "app_key_id"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
},
{
"name": "Forbidden",
"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/v2/service_accounts/:service_account_id/application_keys/:app_key_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"service_accounts",
":service_account_id",
"application_keys",
":app_key_id"
],
"variable": [
{
"key": "service_account_id"
},
{
"key": "app_key_id"
}
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"<string>\",\n \"<string>\"\n ]\n}"
},
{
"name": "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/v2/service_accounts/:service_account_id/application_keys/:app_key_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"service_accounts",
":service_account_id",
"application_keys",
":app_key_id"
],
"variable": [
{
"key": "service_account_id"
},
{
"key": "app_key_id"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"<string>\",\n \"<string>\"\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/v2/service_accounts/:service_account_id/application_keys/:app_key_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"service_accounts",
":service_account_id",
"application_keys",
":app_key_id"
],
"variable": [
{
"key": "service_account_id"
},
{
"key": "app_key_id"
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"<string>\",\n \"<string>\"\n ]\n}"
}
]
}