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_putBasicAuth(http,TRUE);
CkHttp_putLogin(http,"{{secretId}}");
CkHttp_putPassword(http,"{{secretPassword}}");
resp = CkHttp_QuickRequest(http,"DELETE","https://domain.com/api/incomes/:id/");
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
-u '{{secretId}}:{{secretPassword}}'
https://domain.com/api/incomes/:id/
Postman Collection Item JSON
{
"name": "Destroy",
"request": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/incomes/:id/",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"incomes",
":id",
""
],
"variable": [
{
"key": "id",
"value": "consequa",
"description": "(Required) the `income.id` that you want to delete"
}
]
},
"description": "Delete a specific income from your Belvo account."
},
"response": [
{
"name": "No content",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"url": {
"raw": "{{baseUrl}}/api/incomes/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"incomes",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Unauthorized",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"url": {
"raw": "{{baseUrl}}/api/incomes/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"incomes",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
},
{
"name": "Too Many Sessions",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: basic",
"key": "Authorization",
"value": "Basic <credentials>"
}
],
"url": {
"raw": "{{baseUrl}}/api/incomes/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"incomes",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "[\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t},\n\t{\n\t\t\"code\": \"<string>\",\n\t\t\"message\": \"<string>\",\n\t\t\"request_id\": \"<string>\"\n\t}\n]"
}
]
}