Cloud database for Devices
AirNgin provides a simple cloud key/value storage API for Device data that should survive local memory loss or hardware replacement scenarios.
The source contract allows a small number of records per Device and is intended for compact product state rather than bulk telemetry storage.
Store or update a record
Key is the producer-defined identifier for the stored value. The current API contract limits the key to 20 characters and expects English letters/numbers.
POST https://app.airngin.com/api/v1.0/DeviceCloud/AddNewData
Content-Type: application/x-www-form-urlencoded
Fields:
| Field | Type | Meaning |
|---|---|---|
Username | String | MQTT username issued to the Device |
Password | String | MQTT password issued to the Device |
DeviceSerial | String | AirNgin DeviceSerial |
ProjectCode | String | Project code |
Key | String | Record key |
Value | String | Value to store; JSON is allowed |
Calling AddNewData again with the same key updates the existing value.
Read a record
POST https://app.airngin.com/api/v1.0/DeviceCloud/GetDeviceCloud
Send the same authentication/identity fields plus Key.
Delete a record
DELETE https://app.airngin.com/api/v1.0/DeviceCloud/DeleteData
The delete endpoint receives the identity/key fields from the query string according to the current contract.
Validation codes documented by the current API
| Code | Meaning |
|---|---|
8031069 | Username is required |
8031070 | Password is required |
8031008 | DeviceSerial is required |
8031071 | DeviceSerial must match the required 14-character format |
8031007 | ProjectCode is required |
8031065 | ProjectCode must match the required platform length |
8031072 | Key is required |
8031074 | Key cannot exceed 20 characters |
8031075 | Key may contain only English letters and digits |