Calls
To access the API‘s endpoints, HTTP calls need to be sent to the following URL.
https://www.cryptofacilities.com/derivatives/api/v3 |
For calls of private endpoints, the following HTTP headers must be provided: apiKey and
authent. Including the nonce in the request is optional.
**MTF Members only**
For all endpoints which modify orders, the algoId header must be provided. The algoId can be generated via the trading UI.
Example | |
The following shows an example for the inclusion of HTTP headers in Java. For full
String url = "https://www.cryptofacilities.com/derivatives/api/v3/sendOrder";
where apiKey and authent are determined as described earlier. The algoId is generated via the trading UI. |
Calls of endpoints that do not change the state of the server should be submitted with requestType
= GET and with postData being submitted in the URL. Calls of endpoints that do change the state of the server should be submitted with requestType = POST and with postData being submitted either in the URL (encoded) or in the request BODY.
Returns
The API’s returns are in JSON format. If the call was successful, the return includes the requested
information or feedback on the requested action. See Public and Private REST API documentation for a description of the returns for each endpoint.
If a call was successful, the result key in the root structure will have the value success.
For calls of private endpoints, the following HTTP headers must be provided: apiKey and
authent. Including the nonce in the request is optional.
Example | |
The following shows the return of a successful call of the sendorder endpoint. { "result":"success", "serverTime":"2016-02-25T09:45:53.818Z", "sendStatus":{ "receivedTime":"2016-02-25T09:45:53.601Z", "status":"placed", "order_id":"c18f0c17-9971-40e6-8e5b10df05d422f0" } } |
Note that if a call comes back with result equal to success, this merely means that the request has
been received and assessed successfully. It does not necessarily mean that the desired operation has been performed. Details on the operation’s status are returned in a status key, where applicable.
Example | |
The following shows the return of a successful call of the sendorder endpoint where the desired operation was not performed. { |