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 codeCodeCausesDescription
200VEHICLE_INTERACTION_ERRORCOMMAND_FAILED, VEHICLE_OFFLINE, GATEWAY_TIMEOUT, GATEWAY_ERROR, GATEWAY_FAILED, UNKNOWN_ERRORThe command interaction failed for: some malfunction of the vehicle, vehicle is offline, a problem of the gateway or response format not recognized.
200VEHICLE_STATUS_ERROROPEN_TRUNK, ALARM_ACTIVATEDThe vehicle is not in the correct status to execute the command.

Generic

HTTP codeCodeCausesDescription
400VALIDATION_ERRORBAD_FORMAT, INVALID_SIGNAL_NAME, INVALID_COMMAND_NAME, INVALID_UUIDThe data provided doesn't match the requested data from the endpoint.
401AUTHENTICATION_ERRORHEADER_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, UNKNOWNThe credentials provided are not valid.
403AUTHORIZATION_ERRORINSUFFICIENT_PERMISSIONS, UNKNOWNThe token provided doesn't have access to the requested resource.
The vehicle's UUID provided doesn't exist.
404NOT_FOUND_ERRORMISSING_SIGNAL, ROUTE_NOT_FOUNDThe signal is not yet registered in the system.
The route provided doesn't exist.
500INTERNAL_ERRORINTERNAL_ERRORThe server encountered an unexpected error.