Back to Collection Items
#include <C_CkHttp.h>
#include <C_CkHttpResponse.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
HCkHttpResponse resp;
int respStatusCode;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
CkHttp_SetRequestHeader(http,"Accept","application/json");
resp = CkHttp_QuickRequest(http,"DELETE","https://api.app.ddog-gov.com/api/v2/services/definitions/:service_name");
if (CkHttp_getLastMethodSuccess(http) == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
return;
}
respStatusCode = CkHttpResponse_getStatusCode(resp);
printf("Response Status Code = %d\n",respStatusCode);
if (respStatusCode != 204) {
printf("Response Header:\n");
printf("%s\n",CkHttpResponse_header(resp));
printf("Response Body:\n");
printf("%s\n",CkHttpResponse_bodyStr(resp));
printf("Failed.\n");
CkHttpResponse_Dispose(resp);
CkHttp_Dispose(http);
return;
}
CkHttpResponse_Dispose(resp);
printf("Success.\n");
CkHttp_Dispose(http);
}
Curl Command
curl -X DELETE
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v2/services/definitions/:service_name
Postman Collection Item JSON
{
"name": "Delete a single service definition",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/services/definitions/:service_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"services",
"definitions",
":service_name"
],
"variable": [
{
"key": "service_name",
"value": "<string>"
}
]
},
"description": "Delete a single service definition in the Datadog Service Catalog."
},
"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/services/definitions/:service_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"services",
"definitions",
":service_name"
],
"variable": [
{
"key": "service_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/v2/services/definitions/:service_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"services",
"definitions",
":service_name"
],
"variable": [
{
"key": "service_name"
}
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"errors\": [\n \"<string>\",\n \"<string>\"\n ]\n}"
},
{
"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/services/definitions/:service_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"services",
"definitions",
":service_name"
],
"variable": [
{
"key": "service_name"
}
]
}
},
"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/services/definitions/:service_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"services",
"definitions",
":service_name"
],
"variable": [
{
"key": "service_name"
}
]
}
},
"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/services/definitions/:service_name",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"services",
"definitions",
":service_name"
],
"variable": [
{
"key": "service_name"
}
]
}
},
"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}"
}
]
}