HTTP API Documentation
Table of Contents
- Authentication APIs
- Device Management
- Media Resource Management
- Program Management
- Entity Query
- Relation Management
- File Upload
- Other APIs
Authentication APIs
User Login
- Method: POST
- Path:
/api/nauth/login - Parameters:json
{ "username": "admin", "password": "password" } - Success Response:json
{ "token": "JWT token" } - Failure Response:
401 Unauthorized
Change Password
- Method: POST
- Path:
/api/user/setPwd - Parameters:json
{ "oldPwd": "old password", "newPwd": "new password" } - Success Response:
200 OK - Failure Response:
401 Unauthorized
Get User Info
- Method: GET
- Path:
/api/user - Response:json
{ "id": "user ID", "email": "user@localhost", "authority": "TENANT_ADMIN", "tenantId": "tenant ID", "customerId": "customer ID" }
Device Management
Create Device
- Method: POST
- Path:
/api/device - Parameters: Device JSON object
- Response: Created device object
Delete Device
- Method: DELETE
- Path:
/api/device/{device ID} - Response:
200 OK
Get Device by Credential
- Method: GET
- Path:
/api/device/cre/{device credential} - Response: Device object
Batch Get Devices
- Method: GET
- Path:
/api/device/ids - Parameters:
ids=id1,id2,id3 - Response: Device list
Device RPC Call
- Method: POST
- Path:
/api/device/rpc/{device ID} - Parameters: RPC command object
- Response: RPC response object
Get Device Attributes
- Method: GET
- Path:
/api/device/attributes - Parameters:
deviceId: Device IDscope: Attribute scope (default: CLIENT_SCOPE)keys: Attribute keys (comma separated)
- Response: Attribute key-value pairs
Media Resource Management
Batch Get Media Resources
- Method: GET
- Path:
/api/mhoss/ids - Parameters:
ids=id1,id2,id3 - Response: MHOss list (includes LAN access URLs)
Get Unused Media Resources
- Method: GET
- Path:
/api/mhoss/notUsed - Parameters:
startTime: Start timestampendTime: End timestamppage: Page numberpageSize: Items per pagetextSearch: Search text
- Response: Paginated MHOss list (includes LAN access URLs)
Delete Media Resources
- Method: DELETE
- Path:
/api/mhoss/ids - Parameters:
ids=id1,id2,id3 - Response: Delete result
Create/Update Media Resource
- Method: POST
- Path:
/api/mhoss - Parameters: MHOss object
- Response: Created/updated MHOss object
Program Management
Get Program Details
- Method: GET
- Path:
/api/nauth/mhcast/{program ID} - Response: MHCast object (media resources include LAN URLs)
Delete Program
- Method: DELETE
- Path:
/api/mhcast/{program ID} - Response:
200 OK
Create/Update Program
- Method: POST
- Path:
/api/mhcast - Parameters: MHCast object
- Response: Created/updated MHCast object
Notify Program Change
- Method: GET
- Path:
/api/mhcast/notify/{program ID} - Response: Notification result
Get Program Relation List
- Method: GET
- Path:
/api/mhcast/castRelations - Parameters:
deviceId=device ID - Response: Program relation list
Entity Query
Query Entities
- Method: POST
- Path:
/api/entitiesQuery/find - Parameters: EntityDataQuery object
- Response: Paginated entity data result
Relation Management
Create Relation
- Method: POST
- Path:
/api/relation - Parameters: EntityRelation object
- Response: Created relation object
Batch Create Relations
- Method: POST
- Path:
/api/relation/list - Parameters: List of relation objects
- Response:
200 OK
Delete Relation
- Method: DELETE
- Path:
/api/relation - Parameters: EntityRelation object
- Response:
200 OK
Batch Delete Relations
- Method: DELETE
- Path:
/api/relation/ids - Parameters:json
{ "direction": "FROM|TO", "relationType": "relation type", "relationTypeGroup": "relation group", "entityIdList": ["entity ID1", "entity ID2"] } - Response: Number of deleted relations
Query Relation List
- Method: GET
- Path:
/api/relations - Parameters:
- Option 1:
fromId=source ID&fromType=source type - Option 2:
toId=target ID&toType=target type
- Option 1:
- Response: Relation list
File Upload
Upload File
- Method: POST
- Path:
/upload - Format: multipart/form-data
- Field:
uploadfile(file field) - Response:json
{ "provider": "LOCAL", "key": "file storage key", "thumbnail": "base64 thumbnail (if image)" }
Other APIs
Get Current Timestamp
- Method: GET
- Path:
/api/nauth/realts - Response: Current timestamp string
Device Hello Check
- Method: GET
- Path:
/api/nauth/hello - Parameters:
deviceCre: Device credential (optional)port: Port number (optional)
- Response:json
{ "update": "whether LAN address updated", "deviceCre": "server device credential (if not provided in request)" }
Generate Dynamic Device Code (DDC)
- Method: POST
- Path:
/api/nauth/getDdc - Response:json
{ "ddc": "dynamic device code", "expireInMin": 10, "checkInSec": 5 }
Check DDC Status
- Method: GET
- Path:
/api/nauth/checkDdc - Parameters:
ddc=dynamic device code - Response:json
{ "verifiedTs": "verification timestamp (0 means not verified)" }
Input DDC Verification Code
- Method: POST
- Path:
/api/device/inputDdc - Parameters:
- Query:
ddc=dynamic device code - Body: Verification code string or JSON
{"code": "verification code"}
- Query:
- Response: Verification result