Back to Collection Items
var
http: TChilkatHttp;
success: Integer;
resp: IChilkatHttpResponse;
respStatusCode: Integer;
begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http := TChilkatHttp.Create(Self);
http.SetRequestHeader('Authorization','{{apiKey}}');
resp := http.QuickRequest('DELETE','https://api.easybill.de/rest/v1/customers/:id');
if (http.LastMethodSuccess = 0) then
begin
Memo1.Lines.Add(http.LastErrorText);
Exit;
end;
respStatusCode := resp.StatusCode;
Memo1.Lines.Add('Response Status Code = ' + IntToStr(respStatusCode));
if (respStatusCode <> 204) then
begin
Memo1.Lines.Add('Response Header:');
Memo1.Lines.Add(resp.Header);
Memo1.Lines.Add('Response Body:');
Memo1.Lines.Add(resp.BodyStr);
Memo1.Lines.Add('Failed.');
Exit;
end;
Memo1.Lines.Add('Success.');
Curl Command
curl -X DELETE
-H "Authorization: {{apiKey}}"
https://api.easybill.de/rest/v1/customers/:id
Postman Collection Item JSON
{
"name": "Delete customer",
"request": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/customers/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"customers",
":id"
],
"variable": [
{
"key": "id",
"value": "<long>",
"description": "(Required) ID of customer that needs to be deleted"
}
]
}
},
"response": [
{
"name": "Successful operation",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: apikey",
"key": "Authorization",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/customers/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"customers",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
},
{
"name": "Not found",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: apikey",
"key": "Authorization",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/customers/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"customers",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
},
{
"name": "Too Many Requests",
"originalRequest": {
"method": "DELETE",
"header": [
{
"description": "Added as a part of security scheme: apikey",
"key": "Authorization",
"value": "<API Key>"
}
],
"url": {
"raw": "{{baseUrl}}/customers/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"customers",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
}
]
}