Chilkat Online Tools

phpAx / easybill REST API / Delete post box

Back to Collection Items

<?php

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

// For versions of Chilkat < 10.0.0, use new COM('Chilkat_9_5_0.Chilkat.Http')
$http = new COM("Chilkat.Http");

$http->SetRequestHeader('Authorization','{{apiKey}}');

// resp is a Chilkat.HttpResponse
$resp = $http->QuickRequest('DELETE','https://api.easybill.de/rest/v1/post-boxes/:id');
if ($http->LastMethodSuccess == 0) {
    print $http->LastErrorText . "\n";
    exit;
}

$respStatusCode = $resp->StatusCode;
print 'Response Status Code = ' . $respStatusCode . "\n";
if ($respStatusCode != 204) {
    print 'Response Header:' . "\n";
    print $resp->Header . "\n";
    print 'Response Body:' . "\n";
    print $resp->BodyStr . "\n";
    print 'Failed.' . "\n";

    exit;
}

print 'Success.' . "\n";

?>

Curl Command

curl -X DELETE
	-H "Authorization: {{apiKey}}"
https://api.easybill.de/rest/v1/post-boxes/:id

Postman Collection Item JSON

{
  "name": "Delete post box",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/post-boxes/:id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "post-boxes",
        ":id"
      ],
      "variable": [
        {
          "key": "id",
          "value": "<long>",
          "description": "(Required) ID of post box"
        }
      ]
    }
  },
  "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}}/post-boxes/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "post-boxes",
            ":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}}/post-boxes/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "post-boxes",
            ":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}}/post-boxes/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "post-boxes",
            ":id"
          ],
          "variable": [
            {
              "key": "id"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}