HTTP Responses
The MoveUSD APIs behave consistently across the board, when it comes to HTTP statuses and error responses.
Successful responses
You can expect 2xx HTTP responses from APIs when a request was successfully process:
| Code | Summary | Description |
|---|---|---|
| 200 | OK | The request was successfully received, understood and processed. |
| 201 | CREATED | The request was successfully received, understood, processed and a resource has been created as a result. |
| 202 | ACCEPTED | The request was successfully received, understood and will be processed asynchronously. |
| 204 | NO CONTENT | The request was successfully received, understood, processed and an empty response was returned. |
Successful responses are usually accompanied with a JSON payload (except for 204 responses) that describes the resource that was acted upon.
Error responses
Error responses, that require your attention or action, are typically returned with 4xx HTTP Status code.
| Code | Summary | Description |
|---|---|---|
| 400 | BAD REQUEST | The request could not be parsed or understood. |
| 401 | UNAUTHORIZED | The request contains no or invalid credentials. |
| 403 | FORBIDDEN | The authenticated user is not authorised to perform the action. |
| 404 | NOT FOUND | The requested resource could not be found. |
| 429 | TOO MANY REQUESTS | The API user has hit an API or swap rate limit and can not be processed at this time. |
These errors response return a consistent JSON structure as payload:
{
"code": "<error code>",
"message: "<human-readable informational message>",
...<additional information fields>
}The specification for each API operation enumerates the set of possible error codes that it may return. It is recommended to use code field to distinguish between the types of errors in the client code. message field is informational only and should not be used for error matching.
Some errors may provide additional fields to help diagnose the problem. These fields are also specified in the API specification for that operation.
Internal errors
There are occasions when an unexpected error occurs within the platform, likely due to a downstream error, outage, etc. These errors will return a 5xx response.
It is unlikely that this will require any action on your end. If the issue persists, please contact support.
Internal errors will return a generic JSON payload and do not expose any more information for security reasons.
{
"code": "INTERNAL",
"message": "An unexpected internal error has occurred"
}Tips
Search endpoint responses
Search endpoints, normally GET /<resource name>, tend to only return HTTP 200 responses, even if no results were found. Instead, the items array in the response would be empty.
This is consistent with our conventions, as the search was successfully completed so a 200 response is applicable.
Large payload error response
The API platform protects against payloads that are considered too large for processing. This is a security feature and cannot be circumnavigated.
If you send a payload that is too large, you may receive a HTTP 403 response with the following payload:
{ "message: "Forbidden" }Updated 2 days ago
