Get symbol filters for an account. Will return an empty array if no filters have been added to the account.
URL: https://www.trade-copier.com/webservice/v4/filter/getFiltersSymbols.php
Response: JSON object list
| Field Name | Field Type | Field Description |
|---|---|---|
| user_id | string | Unique identifier of the account |
| symbol | string | The symbol being filtered |
| status | string | The status of the symbol, will be the same value for all of them. 1=On, 0=Off |
| type | string | If the symbol is whitelisted or blacklisted, will be the same value for all of them. 0= Whitelist, 1=Blacklist |
PHP example
<?php
echo "<link rel='stylesheet' type='text/css' href='https://www.trade-copier.com/webservice/example.css'>";
$url="https://www.trade-copier.com/webservice/v4/filter/getFiltersSymbols.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
$filter = ['user_id' => 'ABC'];
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('filtersSymbol', $json))
{
echo '<table id="api_data">';
foreach($json->filtersSymbols as $row) {
foreach($row as $key => $val) {
echo '<th>'.$key.'</th>';
}
break;
}
foreach($json->filtersSymbol as $filter)
{
echo '<tr>';
foreach($filter as $key => $val)
{
echo '<td>'.$val.'</td>';
}
echo '</tr>';
}
echo '</table>';
}
else
{
//This is an error message that can be access like this:
//echo $json->code." ".$json->error;
echo json_encode($json);
}
?>