Request & Response format

Request format

Data payloads in requests must be encoded using JSON, and accompanied by a Content-Type: application/json HTTP header.

πŸ‘

Request example:

See an example of Request headers and body to the right of the page.

πŸ“˜

Authentication:

Most endpoints require authentication. The authenticated person is the end-user/trader from Coinify's system point of view. Authentication is performed using the **Authorization** header and Bearer access_token value.

See Authentication section on how to obtain one.

User-Agent header

In order for Coinify to easily track which API endpoints are being used by which partners (Coinify's clients using the Trade API or Trade Widget) - and to assist in integration troubleshooting, we strongly suggest that you supply a custom User-Agent HTTP header with a user agent string that is unique to your implementation.

As some parts of our API also read the user agent to optimize the experience for a specific platform, please also add Android or iOS to the user agent if you know that your end-user will be using one of those platforms.

Response format

The API always responds with a HTTP status code and usually a JSON object in the response body. This JSON object carries the data of the response, or an error object which provides more information about the error other than the HTTP status code. If the endpoint doesn’t return any data, the response body is empty.

You can determine whether a call was successful or not by checking the HTTP status code.

Success format

The body of a successful response (HTTP status code is 2xx) will always be a JSON object or an empty body (if no data needs to be returned).

The contents of the response JSON object depends entirely on the endpoint and the type of operation performed.

πŸ‘

Info:

Check the Success response example by clicking on the "200 - Result" button on the right.

Error format

Whenever a request fails (the HTTP status code is 4xx or 5xx), the API returns a JSON object with two or three strings:

error - Contains a machine-readable error code
error_description - Contains a human-readable error message
request_id - Contains an ID of the request used for troubleshooting

πŸ‘

Info:

Check the Error response example by clicking on the "400 - Result" button on the right.

Language
Click Try It! to start a request and see the response here!