Chilkat Online Tools

Perl / WAC API / Delete a Sub-Account

Back to Collection Items

use chilkat();

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

$http = chilkat::CkHttp->new();

$http->SetRequestHeader("Authorization","{{WACApiKey}}");

# resp is a HttpResponse
$resp = $http->QuickRequest("DELETE","https://domain.com/v1/accounts/:AcctNum");
if ($http->get_LastMethodSuccess() == 0) {
    print $http->lastErrorText() . "\r\n";
    exit;
}

print $resp->get_StatusCode() . "\r\n";
print $resp->bodyStr() . "\r\n";

Curl Command

curl -X DELETE
	-H "Authorization: {{WACApiKey}}"
https://domain.com/v1/accounts/:AcctNum

Postman Collection Item JSON

{
  "name": "Delete a Sub-Account",
  "request": {
    "method": "DELETE",
    "header": [
      {
        "key": "Authorization",
        "value": "{{WACApiKey}}",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": ""
    },
    "url": {
      "raw": "{{baseURL}}/v1/accounts/:AcctNum",
      "host": [
        "{{baseURL}}"
      ],
      "path": [
        "v1",
        "accounts",
        ":AcctNum"
      ],
      "variable": [
        {
          "key": "AcctNum",
          "value": ""
        }
      ]
    }
  },
  "response": [
  ]
}