The error messages are returned to the caller by the server when an API request fails. All the errors returns as a JSON object and all have the same object structure.
The HTTP status code always is 200. If you receive an HTTP status different than 200, please check your request URL to make sure you really hit the API.
All error messages
There are 5 different errors messages that can be thrown to the caller by the CommerscaleTM API.
All the errors that are returned from the API have the same JSON structure. Only the values change from error to error.
Example of error returned
{
"error": {
"code": 500,
"message": "An unhandled exception occured. Please check your API request for any error."
}
}
General (custom) error
Applies to: GET, CREATE, UPDATE, DELETE
Error code: 500
An unhandled error has occured.
Example 1
An unhandled exception occured. Please check your API request for any error.
Example 6
[DYNAMIC MESSAGE]. Please check your API request.
Handler not found
Applies to: GET, CREATE, UPDATE, DELETE
Error code: 404
The URL is incorrect, it does not correspond to any API handler.
Example 1
The URL you specified is not associated with any API handler. Please check the URL and API documentation and try again.
Invalid JSON
Applies to: GET, CREATE, UPDATE, DELETE
Error code: 500
The JSON object is invalid or incorrectly formated.
Example 1
The JSON request you made is invalid. Please check the documentation and try again.
Invalid filter
Applies to: GET
Error code: 500
There is at least one missing or invalid filter.
Example 1
Incorrect value format for 'filters.name[1]'. Excepted : 'string'. No empty values accepted.
Example 2
Incorrect value format for 'filters.active[2]'. Excepted : 'boolean' ('true' or 'false'). No empty values accepted.
Unauthorized access
Applies to: GET, CREATE, UPDATE, DELETE
Error code: 401
You tried to access something you don't have access to.
Example 1
You are not authorized to make this call. Please check your API key, App API key or Email/Password combination and request.