Back to Collection Items
        <?php
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
$http = new COM("Chilkat.Http");
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {}
$json = new COM("Chilkat.JsonObject");
// Adds the "Authorization: Bearer {{accessToken}}" header.
$http->AuthToken = '{{accessToken}}';
$http->SetRequestHeader('Accept','text/plain, application/json, text/json');
$sbRequestBody = new COM("Chilkat.StringBuilder");
$json->EmitSb($sbRequestBody);
$resp = new COM("Chilkat.HttpResponse");
$success = $http->HttpSb('DELETE','https://domain.com/v2/accounts/{{accountId}}/offices/{{officeId}}',$sbRequestBody,'utf-8','application/json',$resp);
if ($success == 0) {
    print $http->LastErrorText . "\n";
    exit;
}
print $resp->StatusCode . "\n";
print $resp->BodyStr . "\n";
?>
        Curl Command
        curl -X DELETE
	-H "Accept: text/plain, application/json, text/json"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{}'
https://domain.com/v2/accounts/{{accountId}}/offices/{{officeId}}
        Postman Collection Item JSON
        {
  "name": "Delete an office.",
  "request": {
    "method": "DELETE",
    "header": [
      {
        "key": "Accept",
        "value": "text/plain, application/json, text/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{}"
    },
    "url": {
      "raw": "{{baseUrl}}/v2/accounts/{{accountId}}/offices/{{officeId}}",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2",
        "accounts",
        "{{accountId}}",
        "offices",
        "{{officeId}}"
      ],
      "variable": [
        {
          "key": "officeId",
          "value": "{{officeId}}"
        },
        {
          "key": "accountId",
          "value": "{{accountId}}"
        }
      ]
    }
  },
  "response": [
  ]
}