Delete a Master or Slave account from your Trade Copier cockpit
URL: https://www.trade-copier.com/webservice/v4/account/deleteAccount.php
Response: JSON object with account Id
| Field Name | Field Type | Field Description |
|---|---|---|
| account_id | string | Unique identifier of the account |
PHP example
<?php
$url="https://".$_SERVER['SERVER_NAME']."/webservice/v4/account/deleteAccount.php";
$headers = array(
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Bearer [[TOKEN]]',
);
// Open connection
$ch = curl_init();
// Setting the options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Account ID to be removed
$account = [
'account_id' => 'ABC'
];
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($account));
// Execute request
$json = json_decode(curl_exec($ch));
// Close connection
curl_close($ch);
if(array_key_exists('account', $json))
{
//We access the deleted account data
echo "Account ".$json->account->account_id." has been deleted!";
}
else
{
//This is an error message that can be access like this:
//echo $json->code." ".$json->error;
echo json_encode($json);
}
?>