The Tradesync API responses are in JavaScript Object Notation (JSON) format. All responses include result, status and data attributes. Success responses can also include the meta attribute and fail responses can include a code and message attribute.
{
"result": "success",
"status": 200,
"meta": {
"count": 9,
"limit": 1000,
"order": "desc",
"last_id": 1
},
"data": {
"id": 1,
"created_at": "2023-04-21T10:34:23Z",
"updated_at": "2023-04-28T13:32:35Z",
"restored_at": null,
"mt_version": 4,
"account_name": "Test account",
"account_number": 12345,
"password": "122345",
"broker_server_id": 119,
"status": "connection_ok",
"login_response": null,
"last_ping": "2023-04-28T13:32:35Z",
"broker": "Test broker",
"client_name": "test user",
"server": "Broker-Demo",
"trade_mode": "demo",
"leverage": 30,
"is_demo": "no",
"suffix": "",
"equity_protect": "off",
"equity_protect_value": null,
"currency": "GBP",
"balance": 100000.15,
"credit": 0,
"equity": 100064.39,
"free_margin": 97491.73,
"used_margin": 2572.66,
"open_trades": 1,
"pending_orders": 0,
"open_trades_lots": 0.97,
"pending_orders_lots": 0,
"daily_profit": 0,
"weekly_profit": 0.15,
"monthly_profit": 0.15,
"total_profit": 0.15
}
}
{
"result": "fail",
"status": 404,
"code": "not_found",
"message": "The resource does not exist.",
"data": []
}
500 (Internal Server Error)
Field | Description |
---|---|
Result | Success, fail or error |
Status | Http status code |
Code | A parsable string |
Message | Code description |
Data | Array of data (if applicable) |
There are 3 types of results
The HTTP status code displayed for reference.
A parsable string that can be used programmatically detect certain results.
A description of the parsable code.
An array of data that relates to the specific request.
An array of options for the response to be returned, only on multiples.
Key | Value | Description |
---|---|---|
count | integer | The total records in the data array |
limit | integer | Record limit per response |
order | asc or desc | The order of the records |
last_id | integer | The last id of the record set |