Docs › API reference › IoT (read-only)
IoT (read-only)
Devices, sensor readings, alerts, irrigation schedules. API keys have no device-control API.
24 operations · base /api/v1/iot
/api/v1/iot/alert-rulesList alert rules
Filter by deviceId (optional).
iot.alerts.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/alert-rules" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
[
{
"consecutive_breach_count": 1,
"cooldown_hours": 1,
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"device_name": "…",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"is_active": true,
"sensor_type": "…",
"threshold_max": 1.5,
"threshold_min": 1.5
}
]/api/v1/iot/alertsList alerts
Filter by deviceId / status / severity / from / to. Paginated.
iot.alerts.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | query | no | — |
status | string | query | no | — |
severity | string | query | no | — |
from | date | query | no | — |
to | date | query | no | — |
page | int | query | no | — |
pageSize | int | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/alerts" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"items": [
{
"acknowledged_at": "2026-10-28T07:30:00Z",
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"resolved_at": "2026-10-28T07:30:00Z",
"rule_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"sensor_type": "…",
"severity": "…",
"status": "…",
"threshold": "…",
"triggered_at": "2026-10-28T07:30:00Z",
"value": 1.5
}
],
"page": 1,
"page_size": 1,
"total": 1
}/api/v1/iot/commandsList device commands
Filter by deviceId (optional). Paginated.
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | query | no | — |
page | int | query | no | — |
pageSize | int | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/commands" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"items": [
{
"acknowledged_at": "2026-10-28T07:30:00Z",
"command_type": "…",
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"payload": "…",
"sent_at": "2026-10-28T07:30:00Z",
"sent_by_user_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"status": "…"
}
],
"page": 1,
"page_size": 1,
"total": 1
}/api/v1/iot/devicesList IoT devices
Filter by status. Paginated.
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
status | string | query | no | — |
page | int | query | no | — |
pageSize | int | query | no | — |
parcelId | GUID | query | no | — |
unassigned | bool | query | no | — |
zoneId | GUID | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"items": [
{
"created_at": "2026-10-28T07:30:00Z",
"device_code": "…",
"device_type": "…",
"dong_ho_nuoc": "…",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"is_online": true,
"last_heartbeat": "2026-10-28T07:30:00Z",
"location_lat": 1.5,
"location_lng": 1.5,
"mac_address": "…",
"manual_max_min": 1,
"mcv_valve_variant": "…",
"mqtt_topic_prefix": "…",
"name": "…",
"niche": "…",
"parcel_ids": [
"0190a3c2-5b1e-7c3d-8e4f-000000000001"
],
"provision_status": "…",
"scene_kind": "…",
"shared_in_zone": true,
"status": "…",
"tran_thoi_luong": "…",
"zone_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001"
}
],
"page": 1,
"page_size": 1,
"total": 1
}/api/v1/iot/devices/control-statesControl status of multiple devices (multi-house screen)
Filter by zoneId (optional).
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
zoneId | GUID | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/control-states" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
[
{
"catalog": [
{
"key": "…",
"kind": "…",
"label": "…",
"valid_values": [
1
]
}
],
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"device_outputs": [
{
"auto_mode": 1,
"family": "…",
"index": 1,
"key": "…",
"kind": "…",
"label": "…",
"mcv_actual": 1,
"mcv_set": 1,
"mcv_stat": 1,
"port": 1,
"role": "…",
"state": 1,
"type": "…",
"valid_values": [
1
]
}
],
"fert1_open": true,
"fert2_open": true,
"fert_open_mask": 1,
"fert_pump_lock": 1,
"fert_pump_run": 1,
"fert_pump_suy_ra": 1,
"fert_pump_why": 1,
"flow_lmin": 1.5,
"is_gateway_firmware": true,
"is_online": true,
"mcv_run": null,
"outputs": 1,
"pump_flushing": true,
"pump_irrigating": true,
"pump_mode": 1,
"pump_on": true,
"reported_at": "2026-10-28T07:30:00Z",
"shade": 1,
"shade_closing": true,
"shade_opening": true,
"vol_cur_ml": 1
}
]/api/v1/iot/devices/{deviceId}/control-stateActual control status of a device
Decoded from the outputs bitmask + pump/winch/shade/flow (status every 5s). FE polls ~5s.
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/control-state" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"catalog": [
{
"key": "…",
"kind": "…",
"label": "…",
"valid_values": [
1
]
}
],
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"device_outputs": [
{
"auto_mode": 1,
"family": "…",
"index": 1,
"key": "…",
"kind": "…",
"label": "…",
"mcv_actual": 1,
"mcv_set": 1,
"mcv_stat": 1,
"port": 1,
"role": "…",
"state": 1,
"type": "…",
"valid_values": [
1
]
}
],
"fert1_open": true,
"fert2_open": true,
"fert_open_mask": 1,
"fert_pump_lock": 1,
"fert_pump_run": 1,
"fert_pump_suy_ra": 1,
"fert_pump_why": 1,
"flow_lmin": 1.5,
"is_gateway_firmware": true,
"is_online": true,
"mcv_run": null,
"outputs": 1,
"pump_flushing": true,
"pump_irrigating": true,
"pump_mode": 1,
"pump_on": true,
"reported_at": "2026-10-28T07:30:00Z",
"shade": 1,
"shade_closing": true,
"shade_opening": true,
"vol_cur_ml": 1
}/api/v1/iot/devices/{deviceId}/display-prefsGET /api/v1/iot/devices/{deviceId}/display-prefs
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/display-prefs" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"control_sensors": [
"…"
],
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001"
}/api/v1/iot/devices/{deviceId}/fert-metersFertilizer tank meters: port, board factor in use, and latest raw pulse count
pulse_at = null means NO pulse has EVER been received from this device. Within each channel: pulse = -1 means no meter / unreadable · 0 means a meter IS present but has not turned · null means the board has not sent that field. Three values, three different meanings.
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/fert-meters" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"channels": [
{
"chu_ky_ly_do": "…",
"chu_ky_server_tinh": {
"lit": 1.5,
"moc_tai": "2026-10-28T07:30:00Z",
"xung_tu_dau_cu": 1
},
"cu_truoc_lit": 1.5,
"dong_bo": {
"da_gui": 1,
"echo_luc": "2026-10-28T07:30:00Z",
"gui_luc": "2026-10-28T07:30:00Z",
"trang_thai": "…"
},
"idx": 1,
"meter_id": 1,
"meter_in": 1,
"meter_ulp": 1,
"meter_ulp_operator": 1,
"meter_ulp_operator_at": "2026-10-28T07:30:00Z",
"pulse": 1,
"server_tinh": {
"lit": 1.5,
"ly_do": "…",
"nguon": "…",
"ulp_da_dung": 1
}
}
],
"chu_ky_bat_dau_luc": "2026-10-28T07:30:00Z",
"device_code": "…",
"flow_pulse": 1,
"muc_tieu_lit_chu_ky": 1,
"pulse_at": "2026-10-28T07:30:00Z",
"pulse_ml": 1,
"pulse_ul": 1,
"water_chu_ky_server_tinh": {
"lit": 1.5,
"ly_do": "…",
"nguon": "…",
"ulp_da_dung": 1
},
"water_server_tinh": {
"lit": 1.5,
"ly_do": "…",
"nguon": "…",
"ulp_da_dung": 1
},
"water_ulp_operator": 1,
"water_ulp_operator_at": "2026-10-28T07:30:00Z"
}/api/v1/iot/devices/{deviceId}/output-config/channelsList configured output channels (reads the copy persisted by the backend from the dev_cfg echo — independent of realtime)
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/output-config/channels" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
[
{
"auto_mode": 1,
"eh": 1,
"em": 1,
"idx": 1,
"kind": 1,
"label": "…",
"manual_max_min": 1,
"online": true,
"out_a": 1,
"out_b": 1,
"reported_at": "2026-10-28T07:30:00Z",
"role": "…",
"sh": 1,
"sm": 1,
"thr_off": 1,
"thr_on": 1
}
]/api/v1/iot/devices/{deviceId}/output-config/irrigationAssigned irrigation system configuration: pumps/zone valves/fertilizer valves including Denso valves (reads the copy persisted by the backend from the irr_out echo — independent of realtime)
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/output-config/irrigation" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
[
{
"idx": 1,
"kind": "…",
"label": "…",
"manual_max_min_bo": 1,
"mcv_id": 1,
"meter_echo_at": "2026-10-28T07:30:00Z",
"meter_id": 1,
"meter_in": 1,
"meter_ulp": 1,
"meter_ulp_operator": 1,
"meter_ulp_operator_at": "2026-10-28T07:30:00Z",
"meter_ulp_pushed": 1,
"meter_ulp_pushed_at": "2026-10-28T07:30:00Z",
"out": 1,
"parcel_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"role": "…",
"updated_at": "2026-10-28T07:30:00Z"
}
]/api/v1/iot/devices/{deviceId}/output-config/mcv-cfgDenso valve settings sync status: the value set (desired), what the board holds (reported, from the dev_cfg echo), ack, and one of 8 states
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/output-config/mcv-cfg" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"ack": {
"applied": {
"count": 1,
"count_max": 1,
"ec_cap": 1.5,
"ec_on": true,
"ec_target": 1.5,
"enabled": true,
"fert": [
1
],
"k_ul": [
1
],
"liters": 1.5,
"pump_fb": 1,
"ratio": [
1
],
"types": [
1
],
"v": 1,
"wait_min": 1
},
"applied_at": "…",
"detail": "…",
"err": "…",
"ok": true,
"seq": 1,
"ts": 1
},
"desired": {
"count": 1,
"count_max": 1,
"ec_cap": 1.5,
"ec_on": true,
"ec_target": 1.5,
"enabled": true,
"fert": [
1
],
"k_ul": [
1
],
"liters": 1.5,
"pump_fb": 1,
"ratio": [
1
],
"types": [
1
],
"v": 1,
"wait_min": 1
},
"echo_at": "2026-10-28T07:30:00Z",
"pushed_at": "2026-10-28T07:30:00Z",
"reported": {
"count": 1,
"count_max": 1,
"ec_cap": 1.5,
"ec_on": true,
"ec_target": 1.5,
"enabled": true,
"fert": [
1
],
"k_ul": [
1
],
"liters": 1.5,
"pump_fb": 1,
"ratio": [
1
],
"types": [
1
],
"v": 1,
"wait_min": 1
},
"seq": 1,
"state": "…"
}/api/v1/iot/devices/{deviceId}/output-config/summarySummary bundle of the output configuration the server has STORED (free_ports…) — returns raw JSON, independent of realtime (no more flakiness). 204 if the server has never received it.
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/output-config/summary" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
This endpoint does not declare a response schema yet — call it in the API Explorer to see the shape.
/api/v1/iot/devices/{deviceId}/schedulesList a device's timer schedules
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/schedules" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
[
{
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"duration_minutes": 1,
"duration_seconds": 1,
"enabled": true,
"end_date": "2026-10-28",
"family": "…",
"field": "…",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"idx": 1,
"label": "…",
"last_fired_on": "2026-10-28",
"name": "…",
"note": "…",
"start_date": "2026-10-28",
"stop_mode": "…",
"target_liters": 1,
"time_of_day": "…",
"value": 1,
"weekdays": 1,
"zone_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001"
}
]/api/v1/iot/devices/{deviceId}/setpointsGET /api/v1/iot/devices/{deviceId}/setpoints
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<deviceId>/setpoints" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"alarm_temp": 1,
"auto_fan": 1,
"auto_shade": 1,
"auto_winch1": 1,
"auto_winch2": 1,
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"fert1_rate": 1,
"fert2_rate": 1,
"flow_pulse_ml": 1,
"mcv1": 1,
"mcv2": 1,
"mcv3": 1,
"mcv4": 1,
"mcv5": 1,
"mcv6": 1,
"sched_s_eh": 1,
"sched_s_em": 1,
"sched_s_sh": 1,
"sched_s_sm": 1,
"sched_w_eh": 1,
"sched_w_em": 1,
"sched_w_sh": 1,
"sched_w_sm": 1,
"thresh_fan_hum_off": 1,
"thresh_fan_hum_on": 1
}/api/v1/iot/devices/{id}Get an IoT device — full fields for the 4-tab detail page
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
id | GUID | path | yes | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/devices/<id>" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"created_at": "2026-10-28T07:30:00Z",
"customer_code": "…",
"description": "…",
"device_code": "…",
"device_type": "…",
"dong_ho_nuoc": "…",
"firmware_version": "…",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"installed_at": "2026-10-28",
"is_online": true,
"last_heartbeat": "2026-10-28T07:30:00Z",
"location_lat": 1.5,
"location_lng": 1.5,
"mac_address": "…",
"manual_max_min": 1,
"mcv_valve_variant": "…",
"metadata_json": "…",
"mqtt_topic_prefix": "…",
"name": "…",
"niche": "…",
"parcel_ids": [
"0190a3c2-5b1e-7c3d-8e4f-000000000001"
],
"provision_status": "…",
"provisioned_at": "2026-10-28T07:30:00Z",
"scene_kind": "…",
"shared_in_zone": true
}/api/v1/iot/emergency-stopActive emergency stop locks (activeOnly=true, default) or the 20 most recent
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
activeOnly | bool | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/emergency-stop" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
[
{
"active": true,
"already_active": true,
"device_ids": [
"0190a3c2-5b1e-7c3d-8e4f-000000000001"
],
"failed_count": 1,
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"parcel_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"reason": "…",
"release_note": "…",
"released_at": "2026-10-28T07:30:00Z",
"released_by": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"repeat_count": 1,
"results": [
{
"command_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"error": "…",
"error_code": "…",
"family": "…",
"idx": 1,
"label": "…",
"ok": true
}
],
"scope": "…",
"stopped_schedules": 1,
"triggered_at": "2026-10-28T07:30:00Z",
"triggered_by": "0190a3c2-5b1e-7c3d-8e4f-000000000001"
}
]/api/v1/iot/reports/irrigation-logsList irrigation history (paginated)
Paginated irrigation cycles for the Irrigation history table. Filter by deviceId / zoneId / from / to. Sorted newest first. Defaults to the last 7 days, pageSize=20.
iot.telemetry.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | query | no | — |
zoneId | GUID | query | no | — |
from | date | query | no | — |
to | date | query | no | — |
page | int | query | no | — |
pageSize | int | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/reports/irrigation-logs" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"items": [
{
"cycle_at": "2026-10-28T07:30:00Z",
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"duration_sec": 1,
"fert_mask": 1,
"fert_ml": [
1
],
"fert_sec": 1,
"trigger": 1,
"trigger_source": "…",
"volume_l": 1.5,
"zone_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"zone_mask": 1
}
],
"page": 1,
"page_size": 1,
"total": 1
}/api/v1/iot/reports/irrigation-summaryIrrigation report summary
Total litres irrigated + number of control commands + success rate within a time range. Defaults to the last 7 days.
iot.telemetry.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | query | no | — |
from | date | query | no | — |
to | date | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/reports/irrigation-summary" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"command_count": 1,
"from": "2026-10-28T07:30:00Z",
"success_command_count": 1,
"success_rate": 1.5,
"to": "2026-10-28T07:30:00Z",
"total_volume_l": 1.5
}/api/v1/iot/reports/irrigation-summary/exportExport the irrigation report to Excel
Per-cycle irrigation detail table for a time range. Defaults to the last 7 days.
iot.telemetry.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | query | no | — |
from | date | query | no | — |
to | date | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/reports/irrigation-summary/export" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
This endpoint does not declare a response schema yet — call it in the API Explorer to see the shape.
/api/v1/iot/schedules/upcomingUpcoming irrigation slots for the whole farm (grouped by slot)
from (yyyy-MM-dd, defaults to today, Vietnam time), days 1–7, optional device_id.
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
from | date | query | no | — |
days | int | query | no | — |
device_id | GUID | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/schedules/upcoming" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"items": [
{
"anchor_schedule_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"date": "2026-10-28",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"device_name": "…",
"duration_seconds": 1,
"exception_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"fired": true,
"name": "…",
"run_once": true,
"skipped": true,
"time": "…",
"valves": [
"…"
]
}
]
}/api/v1/iot/searchSearch devices
By name · code · MAC · customer code, accent-insensitive. Fewer than 2 characters returns empty. Filtered by allowed zones, like the device list.
iot.devices.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
q | string | query | no | — |
limit | int | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/search" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"devices": [
{
"code": "…",
"edit_path": "…",
"email": "…",
"id": "…",
"path": "…",
"phone": "…",
"subtitle": "…",
"title": "…",
"type": "…"
}
]
}/api/v1/iot/sensor-readingsQuery sensor readings over a time range
Filter by deviceId / zoneId / from / to. Sorted newest first. Default pageSize=200.
iot.telemetry.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
deviceId | GUID | query | no | — |
zoneId | GUID | query | no | — |
from | date | query | no | — |
to | date | query | no | — |
page | int | query | no | — |
pageSize | int | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/sensor-readings" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"items": [
{
"activity_pct": 1.5,
"air_humidity_pct": 1.5,
"air_humidity_pct1": 1.5,
"air_humidity_pct2": 1.5,
"air_humidity_pct3": 1.5,
"air_temp_c": 1.5,
"air_temp_c1": 1.5,
"air_temp_c2": 1.5,
"air_temp_c3": 1.5,
"co2_ppm": 1.5,
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"do_mg_l": 1.5,
"ec_us_cm": 1.5,
"feed_level_pct1": 1.5,
"feed_level_pct2": 1.5,
"feed_weight_kg1": 1.5,
"feed_weight_kg2": 1.5,
"fert_ec_us_cm": 1.5,
"fert_ph": 1.5,
"fw_ver": "…",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"light_lux": 1.5,
"nh3_ppm": 1.5,
"orp_mv": 1.5
}
],
"page": 1,
"page_size": 1,
"total": 1
}/api/v1/iot/sensor-readings/latestLatest value of each device (last 30 minutes)
Used for the realtime Dashboard. Optional zoneId filter.
iot.telemetry.viewTry in API Explorer ▶Parameter
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
zoneId | GUID | query | no | — |
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/sensor-readings/latest" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
[
{
"activity_pct": 1.5,
"air_humidity_pct": 1.5,
"air_humidity_pct1": 1.5,
"air_humidity_pct2": 1.5,
"air_humidity_pct3": 1.5,
"air_temp_c": 1.5,
"air_temp_c1": 1.5,
"air_temp_c2": 1.5,
"air_temp_c3": 1.5,
"co2_ppm": 1.5,
"device_code": "…",
"device_id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"do_mg_l": 1.5,
"ec_us_cm": 1.5,
"feed_level_pct1": 1.5,
"feed_level_pct2": 1.5,
"feed_weight_kg1": 1.5,
"feed_weight_kg2": 1.5,
"fert_ec_us_cm": 1.5,
"fert_ph": 1.5,
"fw_ver": "…",
"id": "0190a3c2-5b1e-7c3d-8e4f-000000000001",
"light_lux": 1.5,
"nh3_ppm": 1.5,
"orp_mv": 1.5
}
]/api/v1/iot/setup/progressIoT device onboarding progress inferred from existing data
iot.devices.viewTry in API Explorer ▶Parameter
No parameters.
Example
curl -X GET "https://api-prod.nextfarm.vn/api/v1/iot/setup/progress" \
-H "Authorization: Bearer <ACCESS_TOKEN>"Sample response
200 OK
{
"completed": 1,
"steps": [
{
"count": 1,
"detail": "…",
"done": true,
"key": "…",
"warning": "…"
}
],
"total": 1
}