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 | BAD_CONFIGURATION , BAD_FORMAT_ERROR , COMMAND_FAILED , COMMAND_TIMEOUT , GATEWAY_ERROR , UNKNOWN_ERROR , VEHICLE_OFFLINE | The command interaction failed for: some malfunction of the vehicle, the vehicle is offline, a problem of the gateway or response format not recognized. |
200 | VEHICLE_STATUS_ERROR | CABLE_LOCK_NOT_LOCKED , DEVICE_UPGRADING , HORSESHOE_LOCK_NOT_LOCKED , KICKSTAND_NOT_VERTICAL , LOW_POWER , MISSING_HELMETS , OPEN_TRUNK , POWERED_ON | The vehicle is not in the correct status to execute the command. |
Webhook only errors
HTTP code | Code | Causes | Description |
---|---|---|---|
403 | CHALLENGE_ERROR | CHALLENGE_FAILED | The provided endpoint is not able to answer the challenge when subscribing to a webhook topic. Check this guide for more information. |
Generic
HTTP code | Code | Causes | Description |
---|---|---|---|
400 | BAD_REQUEST_ERROR | BAD_FORMAT , BAD_REQUEST , INVALID_COMMAND_NAME , INVALID_SIGNAL_NAME , INVALID_SERVICE_ID , INVALID_TOPIC , INVALID_UUID , UNSUPPORTED_COMMAND , UNSUPPORTED_SIGNAL | The data provided doesn't match the required data from the endpoint. |
401 | AUTHENTICATION_ERROR | GET_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 , 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. |
403 | VEHICLE_REGISTRATION_ERROR | VEHICLE_ALREADY_REGISTERED | Returned by the adapters that do not support idempotency for the registration endpoint. |
404 | NOT_FOUND_ERROR | MISSING_SIGNAL , PROFILE_NOT_FOUND , RESOURCE_NOT_FOUND , ROUTE_NOT_FOUND , VEHICLE_NOT_REGISTERED | The requested resource cannot be found. |
409 | CONFLICT_ERROR | PAYLOAD_CONFLICT , PENDING_ACTION , RESOURCE_NOT_AVAILABLE | The 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. |
500 | INTERNAL_ERROR | EXPIRED_TOKEN_MESSAGE , INTERNAL_ERROR , INVALID_TOKEN_MESSAGE , QR_CODE_NOT_FOUND_ERROR , TIMEOUT_ERROR | The server encountered an unexpected error. |
501 | METHOD_NOT_IMPLEMENTED_ERROR | ROUTE_NOT_IMPLEMENTED , URL_METHOD_NOT_IMPLEMENTED | The endpoint being called is either not available or not implemented. |
Updated over 1 year ago