Theme
Error codes
Each failure has a stable code. Your code tests the code, and your app writes its own text for the member.
The SDK
A failed call gives your app an error with three fields.
| Field | Meaning |
|---|---|
code | A stable code. Test this field. |
message | An English text for a developer. Do not show it to a member. |
retryable | true when a new attempt with a new grant can work. |
- Each new attempt needs a new grant from your server.
- A later version of the SDK can add a code. For a code that your app does not know, go by
retryable.
retryable is false for eight codes: BLUETOOTH_UNAUTHORIZED, BLUETOOTH_UNSUPPORTED, PERMISSION_DENIED, NO_GATT_MATCH, CREDENTIAL_REJECTED, RENTAL_NOT_ACTIVE, SDK_TOO_OLD and INVALID_ARGUMENT. It is true for every other code.
The phone
| Code | Meaning | What your app does |
|---|---|---|
BLUETOOTH_OFF | Bluetooth is off. | Ask the member to turn Bluetooth on. |
BLUETOOTH_UNAUTHORIZED | The member blocked Bluetooth for your app. | Send the member to the settings of your app. |
BLUETOOTH_UNSUPPORTED | The phone has no Bluetooth Low Energy. | Send the member to your staff. |
PERMISSION_DENIED | A permission is missing. | Ask for the permission again, or send the member to the settings of your app. |
The way to the lock
| Code | Meaning | What your app does |
|---|---|---|
DEVICE_NOT_FOUND | The lock is not in range. | Ask the member to stand at the locker, and try again. |
CONNECT_TIMEOUT, CONNECT_FAILED | The phone could not connect to the lock. | Try again. |
CONNECTION_LOST, NOT_CONNECTED | The link to the lock dropped. | Try again. |
RESPONSE_TIMEOUT | The lock did not answer. | Try again. |
WRONG_LOCK | The phone reached another lock than the one of the grant. | Try again. |
NO_GATT_MATCH | The device that the phone reached is not a Clevibox lock. | Send the member to your staff. |
The lock
| Code | Meaning | What your app does |
|---|---|---|
ASK_FAILED, BAD_FRAME, CHECKSUM | The lock refused a command, or its answer was damaged. | Try again. |
CREDENTIAL_REQUIRED | The lock asked for its credential again. | Try again. |
CREDENTIAL_REJECTED | The lock rejected its credential. | Send the member to your staff, and tell Clevibox. |
The grant
| Code | Meaning | What your app does |
|---|---|---|
GRANT_INVALID | The grant is unknown, or it was used before. | Get a new grant, and try again. |
GRANT_EXPIRED | The grant is older than 2 minutes. | Get a new grant, and try again. |
RENTAL_NOT_ACTIVE | The rental has ended. | Show that the rental is over. |
Clevibox
| Code | Meaning | What your app does |
|---|---|---|
NETWORK_UNAVAILABLE | The phone cannot reach Clevibox. | Ask the member to check the connection. See Site requirements. |
SERVER_ERROR | Clevibox failed. | Try again after a moment. |
SDK_TOO_OLD | This version of the SDK is too old. | Ask the member to update your app. Release your app with a new SDK. |
Your code
| Code | Meaning | What your app does |
|---|---|---|
OPERATION_IN_PROGRESS | Another call runs. | Wait for the result of that call. Lock your Open button while a call runs. |
INVALID_ARGUMENT | The call has a wrong argument, for example an empty grant. | Correct your code. |
CANCELLED | Your app cancelled the call. readStatus reports a cancel with this code. | Nothing. |
INTERNAL_ERROR | The SDK itself failed. | Try again, and tell Clevibox the message. |
The integration API
A failed request gets an HTTP status of 400 or more, and a body with error, message and sometimes details. See Errors in the API reference.
| Status | error | Meaning | What your server does |
|---|---|---|---|
400 | validation_error | A field is wrong. details.field names it. | Correct the request. |
400 | invalid_id | An ID in the address is not a UUID. | Correct the request. |
401 | invalid_api_key | The key is missing, unknown or revoked. | Check the key and its header. |
403 | not_members_rental | This member does not hold this rental. | Check where your server takes the member ID from. |
404 | club_not_found, compartment_not_found, rental_not_found | Nothing with this ID exists for your key. A test key gets this answer for a live club, and a live key for a test club. | Check the ID and the key. |
409 | compartment_unavailable | Another member holds this compartment. | Show the compartments again. |
409 | compartment_out_of_service | The compartment is out of service. | Show the compartments again. |
409 | member_has_active_rental | The member holds another compartment. details has its rental_id and compartment_id. | Show that compartment to the member. |
409 | rental_not_active | The rental has ended. | Show that the rental is over. |
429 | rate_limited | Too many requests for this key. | Wait for the seconds in the header Retry-After, and send the request again. |
A status of 500 or more means that Clevibox failed. Wait a moment, and send the request again.
