UNIHH-IOTUNIHH-IOT
Home
Guide
Manual
  • 简体中文
  • English
GitHub
Home
Guide
Manual
  • 简体中文
  • English
GitHub
  • Reference

    • API Overview
    • MQTT Topic Reference
    • FAQ

API Overview

All REST endpoints are exposed through the unified gateway (default :28000) and require a JWT token. Interfaces are grouped by resource domain; each domain is reachable under both /api/v1/* and /admin/* prefixes.

Authentication

ItemDescription
Login endpointPOST /api/v1/auth/login, returns a token
Request headerAuthorization: Bearer <token>
Unauthorized401; the frontend redirects to the login page

Resource Domains

ControllerBase pathCoverage
AuthController/api/v1/authSign in, sign out, current user
DashboardController/api/v1/dashboardDashboard cards and chart data
DriverController/api/v1/driversDriver list and state; `GET
DeviceController/api/v1/devicesDevice CRUD, point binding, acquisition toggle, write-back commands
ThingModelController/api/v1/thingmodelsModel template CRUD, property/service/event definitions
RuleController/api/v1/rulesRule CRUD, enable/disable, linked actions
AlarmController/api/v1/alarmsEvent query, acknowledge, recover, disposition notes
LogController/api/v1/logsWrite-back command logs, login audit
SysUserController/api/v1/system/userUser CRUD, state toggle
SysRoleController/api/v1/system/roleRole CRUD, permission assignment
SysMenuController/api/v1/system/menuMenu tree maintenance
SysDictController/api/v1/system/dictDictionary types and entries
ProtocolFallbackController/api/v1/protocolProtocol compatibility fallback

Example Calls

# 1. Sign in to get a token
curl -X POST http://localhost:28000/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "unihhiot"}'

# 2. List devices with the token
curl "http://localhost:28000/api/v1/devices?pageNum=1&pageSize=10" \
  -H "Authorization: Bearer <token>"

# 3. Ping the Modbus driver
curl -X POST http://localhost:28000/api/v1/drivers/modbus/ping \
  -H "Authorization: Bearer <token>"

Notes

  • Responses use the unified R structure (code / message / data); code = 200 means success;
  • Paginated endpoints take pageNum and pageSize;
  • The frontend wraps every call in unihh-frontend/src/api/ — a practical reference for integration work;
  • Drivers also expose a built-in debug endpoint /api/v1/driver/status (on the driver process itself, returning active devices and socket handles); the platform's ping self-check calls it.
Edit this page on GitHub
Last Updated: 11/13/26, 3:34 AM
Contributors: sunqi
Next
MQTT Topic Reference