Get a description of an error from your slave order
URL: https://www.trade-copier.com/webservice/v4/order/getOrderStatusComment.php
You must specify an error id.
Response: JSON object
| Field Name | Field Type | Field Description |
|---|---|---|
| comment | string | Description of the error |
PHP example
<?php
$url="https://www.trade-copier.com/webservice/v4/order/getOrderStatusComment.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 = ['error_id' => 15];
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($filter));
// Execute request
$json = json_decode(curl_exec($ch));
// Close connection
curl_close($ch);
//We access the comment
if(array_key_exists('comment', $json)) {
echo $json->comment;
} else {
//This is an error message that can be access like this:
//echo $json->code." ".$json->error;
echo json_encode($json);
}
?>