Edit the type (whitelist/blacklist) of and/or if to use the filter for all symbol filters for an account.
URL: https://www.trade-copier.com/webservice/v4/filter/editFiltersSymbol.php
You must specify either a type or a status, but both are not necessary.
Response: JSON object with success or error message
Fields noted with a * are optional
| Field Name | Field Type | Field Description |
|---|---|---|
| user_id | string | Unique identifier of the account |
| type* | int | Set type of all symbols on account. 0 = whitelist, 1 = blacklist |
| status* | int | Enable or disable all symbols on account |
PHP example
<?php
$url="https://www.trade-copier.com/webservice/v4/filter/editFiltersSymbol.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);
$filter = ['user_id' => 'ABC', 'status' => '0', 'type' => '1'];
//$filter = ['user_id' => 'ABC', 'type' => '1'];
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($filter));
// Execute request
$json = json_decode(curl_exec($ch));
// Close connection
curl_close($ch);
if(array_key_exists('success', $json))
{
echo 'Symbol edited succesfully';
}
else
{
//This is an error message that can be access like this:
//echo $json->code." ".$json->error;
echo json_encode($json);
}
?>