For all successful requests, the API returns an HTTP status of 200. If there is an error, the API returns an appropriate 4XX or 5XX HTTP status code. In addition, the API passes an error code and message. These messages can help determine the reason for the failure, particularly for poorly formed query parameters.
Example responses for a bad query:
GET /v2/rates/candle.json?base=GBD
HTTP/1.1 400 Bad Request
{
"code" : 1,
"message" : "Invalid or malformed argument; [base] must be a valid 3 letter currency code as defined by [currencies] endpoint (OANDA): (GBD)"
}
GET /v2/rates/candle.xml?base=GBD
HTTP/1.1 400 Bad Request
<response>
<code>1</code>
<message>Invalid or malformed argument; [base] must be a valid 3 letter currency code as defined by [currencies] endpoint (OANDA): (GBD)</message>
</response>
GET /v2/rates/candle.csv?base=GBD
HTTP/1.1 400 Bad Request
code,message
1,"Invalid or malformed argument; [base] must be a valid 3 letter currency code as defined by [currencies] endpoint (OANDA): (GBD)"
The message provided with any particular error may contain additional information to help you determine the cause of the problem, particularly in the case of malformed or invalid query parameters.
code | HTTP Status Code | HTTP Status Message | Message | Detailed description |
---|---|---|---|---|
1 | 400 | Bad Request | Invalid or malformed argument | The argument specified is not properly formatted or is an unaccepted value |
2 | 400 | Bad Request | Missing required argument | |
3 | 401 | Unauthorized | This request requires authorization | |
4 | 403 | Forbidden | The access token provided does not allow this request to be made | The provided API key does not have privilege for the request (no access to Central Bank rates is one instance) |
5 | 500 | Internal Server Error | An internal server error occurred, our engineers have been notified | |
6 | 503 | Service Unavailable | Service Unavailable | The API is down for maintenance |
8 | 400 | Bad Request | Malformed Authorization header or invalid access token | |
11 | 404 | Not Found | Invalid Endpoint | When no matching endpoint could be found |
53 | 403 | Forbidden | Rate limit violation | You have exceeded your allocation of quotes for the current billing period |
54 | 403 | Forbidden | Expected rates returned from this API call is more than the number of quotes remaining for this account | |
55 | 400 | Bad Request | The combinations of currency pairs and dates may not exceed the limit allowed per request | |
56 | 404 | Not Found | The rates requested have not yet been published | |
57 | 405 | Method Not Allowed | Invalid request | Caused by an incompatible HTTP method such as POST, or an invalid header in request |