API Status Codes: What Each Error Means and How to Fix It
Every RESTful API response carries a numeric StatusCode. Code 0 means success. Callback responses are different: your server always answers {"status":"done"} with HTTP 200.
| Code | Status | What it means | What to do |
|---|---|---|---|
| 0 | Success | The operation completed. | Nothing. |
| 1 | Invalid Request Data | The JSON body is malformed or has invalid values. | Send raw JSON in UTF-8 with the header Content-Type: application/json. Check the values. |
| 2 | Invalid Service Tag ID | The stgid query parameter matches no registered device. | Copy the Service Tag ID again from your API Monitor account. |
| 3 | Invalid Request | The request does not follow the format of that operation. | Compare it with the sample request for the operation. |
| 4 | Invalid Encryption | The AES-256 payload could not be decrypted. | Check the encryption key and the Base64 encoding. |
| 5 | Device Offline | The target device is not connected to Cams now. | Check the Device Status page. The command is queued and delivered when the device reconnects. |
| 6 | Operation Timeout | The device did not acknowledge the command in time. | Check that the device is online, then try again. |
| 7 | Invalid Auth Token | The AuthToken does not match the one set for the device. | Use the 32-character token from the API Monitor. |
| 8 | User Already Exists | An add was tried for a UserID that is already on the device. | Update the user instead, or delete the user first. |
| 9 | User Not Found | The UserID is not on the device. | Check the UserID. Add the user first if needed. |
| 10 | Template Error | The biometric template is corrupt or in an unsupported format. | Check the Base64 data, the Size and the Index of the template. |
| 11 | Device Memory Full | The device reached its limit of users or templates. | Delete users or templates that are no longer needed. |
| 13 | Invalid Security Key | The security key does not match the one in the API Monitor. | Use the same key on both sides. |
| 15 | Feature Not Supported | This device model or connection mode does not support the operation. | Check the connection mode. DB Pull and File Processing modes support attendance push only, not RESTful commands. |
| 999 | Unknown Error | An unexpected error. | Contact Cams support and quote the OperationID. |
Tips
- Generate a unique OperationID for each REST request. The response repeats it, so you can match request and response.
- REST commands take about 15 seconds to reach the device.
- Codes 12 and 14 are not used.
Related: Callback URL not receiving data, Add or delete users in bulk.
Need help? Email support@camsbiometrics.com with the OperationID and the StatusCode.
Was this article helpful?