Errors

HTTP response codes

Solvimon uses conventional HTTP response codes to indicate the success or failure of an API request.

  1. Codes in the 2xx range indicate success. Generally, you will get either a 201 or 200, the former for when a resource is created, the latter when fetching information.
  2. Codes in the 4xx range indicate an error that failed given the information provided. Some 4xx errors that could be handled programmatically include an error code briefly explaining the reported error.
  3. Codes in the 5xx range indicate an error with Solvimon's servers (these are rare).
📘

Good to know

Our API responses hold a unique request reference in the header field: X-REQUEST-ID, that holds a value of the following format:reqr_HwDeRw0dFUrJrjCKk31w. It is advised to provide this reference for troubleshooting.


Errors

An error response consists of the following fields:

  1. type: possible values are: API_ERROR and INVALID_REQUEST. The latter will indicate a failure on the request submitted being invalid, the former is where processing failed due to internal issues or other non-recoverable problems
  2. code: programmatic value to indicate what failed, e.g. RESOURCE_NOT_FOUND or UNABLE_TO_PROCESS_INSTRUCTIONS. Below is a list provided for all the existing codes.
  3. field (optional): indicates which field was deemed invalid
  4. message: a human-readable explanation of the response

An example of such a response would be:

{
    "type": "INVALID_REQUEST",
    "code": "INVALID_FIELD",
    "field": "schedules.0.included_volumes.0.number",
    "message": "value required, but not set"
}


List of error codes

A list of the existing error codes that can be within the field code.

Error CodeDescription
RESOURCE_NOT_FOUNDThe requested resource is not found
RESOURCES_NOT_FOUNDThe requested resources are not found
UNABLE_TO_PROCESS_INSTRUCTIONSThe payload of the request can not be processed
UNSUPPORTED_MEDIA_TYPEThe Content-Type of the request is not set or is incorrect
RESOURCE_ALREADY_EXISTSThere is an existing resource with the provided identifier
COULD_NOT_CREATE_RESOURCEThe resource could not be created
COULD_NOT_UPDATE_RESOURCEThe resource could not be updated
COULD_NOT_DELETE_RESOURCEThe resource could not be deleted
MISSING_VERSIONThe version in the path is missing
UNSUPPORTED_VERSIONThe version in the path is not supported
MISSING_IDThe id is missing from the path
INVALID_IDThe id from the path is not valid
MISSING_REFERENCEThe reference is missing from the request
MISSING_FIELDA mandatory field is missing from the request
INVALID_FIELDA field from the request is not valid
INTERNAL_ERRORAn internal error has occurred
UNAUTHORISEDThe credentials provided are invalid
USER_NOT_ALLOWEDThe user has no permission to make the request