Back to Collection Items
#include <C_CkHttpW.h>
#include <C_CkHttpResponseW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkHttpResponseW resp;
int respStatusCode;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
CkHttpW_SetRequestHeader(http,L"Accept",L"application/json");
resp = CkHttpW_QuickRequest(http,L"DELETE",L"https://api.app.ddog-gov.com/api/v2/restriction_policy/:resource_id");
if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
return;
}
respStatusCode = CkHttpResponseW_getStatusCode(resp);
wprintf(L"Response Status Code = %d\n",respStatusCode);
if (respStatusCode != 204) {
wprintf(L"Response Header:\n");
wprintf(L"%s\n",CkHttpResponseW_header(resp));
wprintf(L"Response Body:\n");
wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
wprintf(L"Failed.\n");
CkHttpResponseW_Dispose(resp);
CkHttpW_Dispose(http);
return;
}
CkHttpResponseW_Dispose(resp);
wprintf(L"Success.\n");
CkHttpW_Dispose(http);
}
Curl Command
curl -X DELETE
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v2/restriction_policy/:resource_id
Postman Collection Item JSON
{
"name": "Delete a restriction policy",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/restriction_policy/:resource_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"restriction_policy",
":resource_id"
],
"variable": [
{
"key": "resource_id",
"value": "<string>"
}
]
},
"description": "Deletes the restriction policy associated with a specified resource."
},
"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/restriction_policy/:resource_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"restriction_policy",
":resource_id"
],
"variable": [
{
"key": "resource_id"
}
]
}
},
"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/restriction_policy/:resource_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"restriction_policy",
":resource_id"
],
"variable": [
{
"key": "resource_id"
}
]
}
},
"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": "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/restriction_policy/:resource_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"restriction_policy",
":resource_id"
],
"variable": [
{
"key": "resource_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": "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/restriction_policy/:resource_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"restriction_policy",
":resource_id"
],
"variable": [
{
"key": "resource_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}"
}
]
}