Back to Collection Items
<?php
// 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 new COM('Chilkat_9_5_0.Chilkat.Http')
$http = new COM("Chilkat.Http");
$http->SetRequestHeader('Accept','application/json');
// resp is a Chilkat.HttpResponse
$resp = $http->QuickRequest('DELETE','https://api.app.ddog-gov.com/api/v2/apm/config/metrics/:metric_id');
if ($http->LastMethodSuccess == 0) {
print $http->LastErrorText . "\n";
exit;
}
$respStatusCode = $resp->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/apm/config/metrics/:metric_id
Postman Collection Item JSON
{
"name": "Delete a span-based metric",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/apm/config/metrics/:metric_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"apm",
"config",
"metrics",
":metric_id"
],
"variable": [
{
"key": "metric_id",
"value": "<string>"
}
]
},
"description": "Delete a specific span-based metric from your organization."
},
"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/v2/apm/config/metrics/:metric_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"apm",
"config",
"metrics",
":metric_id"
],
"variable": [
{
"key": "metric_id"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
},
{
"name": "Not Authorized",
"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/apm/config/metrics/:metric_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"apm",
"config",
"metrics",
":metric_id"
],
"variable": [
{
"key": "metric_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/apm/config/metrics/:metric_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"apm",
"config",
"metrics",
":metric_id"
],
"variable": [
{
"key": "metric_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/apm/config/metrics/:metric_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"apm",
"config",
"metrics",
":metric_id"
],
"variable": [
{
"key": "metric_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}"
}
]
}