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_ERRORBAD_CONFIGURATION, BAD_FORMAT_ERROR, COMMAND_FAILED, COMMAND_TIMEOUT, GATEWAY_ERROR, UNKNOWN_ERROR, VEHICLE_OFFLINEThe command interaction failed for: some malfunction of the vehicle, the vehicle is offline, a problem of the gateway or response format not recognized.
200VEHICLE_STATUS_ERRORCABLE_LOCK_NOT_LOCKED, DEVICE_UPGRADING, HORSESHOE_LOCK_NOT_LOCKED, KICKSTAND_NOT_VERTICAL, LOW_POWER, MISSING_HELMETS, OPEN_TRUNK, POWERED_ONThe vehicle is not in the correct status to execute the command.

Webhook only errors

HTTP codeCodeCausesDescription
403CHALLENGE_ERRORCHALLENGE_FAILEDThe provided endpoint is not able to answer the challenge when subscribing to a webhook topic. Check this guide for more information.

Generic

HTTP codeCodeCausesDescription
400BAD_REQUEST_ERRORBAD_FORMAT, BAD_REQUEST, INVALID_COMMAND_NAME, INVALID_SIGNAL_NAME, INVALID_SERVICE_ID, INVALID_TOPIC, INVALID_UUID, UNSUPPORTED_COMMAND, UNSUPPORTED_SIGNALThe data provided doesn't match the required data from the endpoint.
401AUTHENTICATION_ERRORGET_THIRD_PARTY_TOKEN_FAILED, 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, 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.
403VEHICLE_REGISTRATION_ERRORVEHICLE_ALREADY_REGISTEREDReturned by the adapters that do not support idempotency for the registration endpoint.
404NOT_FOUND_ERRORMISSING_SIGNAL, PROFILE_NOT_FOUND, RESOURCE_NOT_FOUND, ROUTE_NOT_FOUND, VEHICLE_NOT_REGISTEREDThe requested resource cannot be found.
409CONFLICT_ERRORPAYLOAD_CONFLICT, PENDING_ACTION , RESOURCE_NOT_AVAILABLEThe payload provided during registration differs from an already registered vehicle with the same identifier.
A command for the specified vehicle is still in execution.
An OTA update is in execution, and the device cannot receive commands.
500INTERNAL_ERROREXPIRED_TOKEN_MESSAGE, INTERNAL_ERROR, INVALID_TOKEN_MESSAGE, QR_CODE_NOT_FOUND_ERROR, TIMEOUT_ERRORThe server encountered an unexpected error.
501METHOD_NOT_IMPLEMENTED_ERRORROUTE_NOT_IMPLEMENTED, URL_METHOD_NOT_IMPLEMENTEDThe endpoint being called is either not available or not implemented.