Errors
2hire uses HTTP response codes to indicate the completion status of an API call.
There are three main groups of response codes:
2XX
success response codes indicate a successful API call. A 2XX response code will still be sent in case of an error during a vehicle interaction due to command failure or connection reset.
4XX
error status codes indicate an error related to the information provided on the API call.
5XX
error status codes indicate 2hire server errors.
e.g. Insufficient permissions response example:
{
"code": "AUTHORIZATION_ERROR",
"errorId": string,
"details": {
"cause": "INSUFFICIENT_PERMISSIONS"
}
}
Error code table:
Command only errors
HTTP code | Code | Causes | Description |
---|---|---|---|
200 | VEHICLE_INTERACTION_ERROR | COMMAND_FAILED , VEHICLE_OFFLINE , GATEWAY_TIMEOUT , GATEWAY_ERROR , GATEWAY_FAILED , UNKNOWN_ERROR | The command interaction failed for: some malfunction of the vehicle, vehicle is offline, a problem of the gateway or response format not recognized. |
200 | VEHICLE_STATUS_ERROR | OPEN_TRUNK , ALARM_ACTIVATED | The vehicle is not in the correct status to execute the command. |
Generic
HTTP code | Code | Causes | Description |
---|---|---|---|
400 | VALIDATION_ERROR | BAD_FORMAT , INVALID_SIGNAL_NAME , INVALID_COMMAND_NAME , INVALID_UUID | The data provided doesn't match the requested data from the endpoint. |
401 | AUTHENTICATION_ERROR | HEADER_MALFORMED , HEADER_MISSING , TOKEN_AUDIENCE_NOT_ALLOWED , TOKEN_CREATION_FAILED , TOKEN_EXPIRED , TOKEN_KEY_ERROR , TOKEN_KEY_ID_ERROR , TOKEN_SIGN_ERROR , TOKEN_VERIFICATION_FAILED , UNKNOWNHEADER_MALFORMED , UNKNOWN | The credentials provided are not valid. |
403 | AUTHORIZATION_ERROR | INSUFFICIENT_PERMISSIONS , UNKNOWN | The token provided doesn't have access to the requested resource. The vehicle's UUID provided doesn't exist. |
404 | NOT_FOUND_ERROR | MISSING_SIGNAL , ROUTE_NOT_FOUND | The signal is not yet registered in the system. The route provided doesn't exist. |
500 | INTERNAL_ERROR | INTERNAL_ERROR | The server encountered an unexpected error. |
Updated 10 months ago
Did this page help you?