.NET Core C# / easybill REST API / Delete the specified position-group discount
Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Chilkat.Http http = new Chilkat.Http();
bool success;
http.SetRequestHeader("Authorization","{{apiKey}}");
Chilkat.HttpResponse resp = http.QuickRequest("DELETE","https://api.easybill.de/rest/v1/discounts/position-group/:id");
if (http.LastMethodSuccess == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
int respStatusCode = resp.StatusCode;
Debug.WriteLine("Response Status Code = " + Convert.ToString(respStatusCode));
if (respStatusCode != 204) {
Debug.WriteLine("Response Header:");
Debug.WriteLine(resp.Header);
Debug.WriteLine("Response Body:");
Debug.WriteLine(resp.BodyStr);
Debug.WriteLine("Failed.");
return;
}
Debug.WriteLine("Success.");
Curl Command
curl -X DELETE
-H "Authorization: {{apiKey}}"
https://api.easybill.de/rest/v1/discounts/position-group/:id
Postman Collection Item JSON
{
"name": "Delete the specified position-group discount",
"request": {
"method": "DELETE",
"header": [
],
"url": {
"raw": "{{baseUrl}}/discounts/position-group/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"discounts",
"position-group",
":id"
],
"variable": [
{
"key": "id",
"value": "<long>",
"description": "(Required) ID of the to be soon deleted discount"
}
]
}
},
"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}}/discounts/position-group/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"discounts",
"position-group",
":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}}/discounts/position-group/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"discounts",
"position-group",
":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}}/discounts/position-group/:id",
"host": [
"{{baseUrl}}"
],
"path": [
"discounts",
"position-group",
":id"
],
"variable": [
{
"key": "id"
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
],
"cookie": [
],
"body": ""
}
]
}