Guides
An IoT dashboard for a farm
Show a farm's latest sensor readings, history and alerts on your own screen — poll periodically and receive alerts instantly by webhook.
1. Create a read-only IoT API key
The farm owner creates a key with scopes iot.devices.view, iot.telemetry.view, iot.alerts.view.
2. List devices and latest readings
Call every 1–5 minutes; use is_online to show which devices are offline.
Examplecurl https://api-prod.nextfarm.vn/api/v1/iot/devices -H "Authorization: Bearer nfk_..." curl https://api-prod.nextfarm.vn/api/v1/iot/sensor-readings/latest -H "Authorization: Bearer nfk_..."3. Chart the history
History for a device or zone over a time range.
Examplecurl "https://api-prod.nextfarm.vn/api/v1/iot/sensor-readings?deviceId=<device_id>&from=2026-10-27&to=2026-10-28" -H "Authorization: Bearer nfk_..."4. Receive alerts instantly
Subscribe to iot.alert.raised and iot.device.offline instead of polling; verify the signature before trusting it.