Deletes all of a setting's symbol mappings
URL: https://www.trade-copier.com/webservice/v4/mapping/deleteAllMappings.php
You must specify a slave or group Id, but not both.
Response: JSON object with success or error message
Fields noted with a * are optional
| Field Name | Field Type | Field Description |
|---|---|---|
| id_master | string | Unique identifier of the master account linked to the mapping |
| id_slave* | string | Unique identifier of the slave account linked to the mapping, or null if defining a template |
| id_group* | string | Unique identifier of the template linked to the mapping, or null if defining a slave |
PHP example
<?php
$url="https://www.trade-copier.com/webservice/v4/mapping/deleteAllMappings.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);
$args= ['id_slave' => "DEF", 'id_master' => "ABC"];
//$args= ['id_group' => "GHI", 'id_master' => "ABC"];
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($args));
// Execute request
$json = json_decode(curl_exec($ch));
// Close connection
curl_close($ch);
if(array_key_exists('success', $json))
{
echo 'Deleted all mappings successfully';
}
else
{
//This is an error message that can be access like this:
//echo $json>code." ".$json>error;
echo json_encode($json);
}
?>