Back to Collection Items
#include <CkHttpW.h>
#include <CkHttpResponseW.h>
void ChilkatSample(void)
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttpW http;
bool success;
http.SetRequestHeader(L"Accept",L"application/json");
CkHttpResponseW *resp = http.QuickRequest(L"DELETE",L"https://api.app.ddog-gov.com/api/v2/team/:team_id/memberships/:user_id");
if (http.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",http.lastErrorText());
return;
}
int respStatusCode = resp->get_StatusCode();
wprintf(L"Response Status Code = %d\n",respStatusCode);
if (respStatusCode != 204) {
wprintf(L"Response Header:\n");
wprintf(L"%s\n",resp->header());
wprintf(L"Response Body:\n");
wprintf(L"%s\n",resp->bodyStr());
wprintf(L"Failed.\n");
delete resp;
return;
}
delete resp;
wprintf(L"Success.\n");
}
Curl Command
curl -X DELETE
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v2/team/:team_id/memberships/:user_id
Postman Collection Item JSON
{
"name": "Remove a user from a team",
"request": {
"method": "DELETE",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v2/team/:team_id/memberships/:user_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"team",
":team_id",
"memberships",
":user_id"
],
"variable": [
{
"key": "team_id",
"value": "<string>"
},
{
"key": "user_id",
"value": "<string>"
}
]
},
"description": "Remove a user from a team."
},
"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/team/:team_id/memberships/:user_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"team",
":team_id",
"memberships",
":user_id"
],
"variable": [
{
"key": "team_id"
},
{
"key": "user_id"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
},
{
"name": "API error response.",
"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/team/:team_id/memberships/:user_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"team",
":team_id",
"memberships",
":user_id"
],
"variable": [
{
"key": "team_id"
},
{
"key": "user_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/team/:team_id/memberships/:user_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v2",
"team",
":team_id",
"memberships",
":user_id"
],
"variable": [
{
"key": "team_id"
},
{
"key": "user_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}"
}
]
}