iotDeviceControl - Call the Service Method in the Things Data Model - Imou Open Platform
iotDeviceControl:Call the Service method in the things data model
Function details
Using the things model to operate the specified Service method on the device
Request address
https://openapi-[DataCenter].easy4ip.com/openapi/iotDeviceControl
Incoming parameter description
| Parameter name | Parameter type | Required or not | Default value | Legal value | Parameter description |
|---|---|---|---|---|---|
| token | String | yes | Administrator or sub-account accessToken | ||
| productId | String | yes | Refers to the productId returned by the listDeviceDetailsByIds and listDeviceDetailsByPage interfaces. If the productId field returned by the list has a value, it indicates that the device is an IoT device and supports calling IoT things data model Interface | unique id of product | |
| deviceId | String | yes | Device serial number | ||
| ref | String | yes | The ref value of service in the things data model | ||
| content | [Object] | yes | View the service methods supported by the device through getProductModel | The method and input parameters corresponding to service in the object model are in the format of - "content": {"ref1 in service": "value value 1", "refN in service": "value N"}. If the method corresponding to service has no input parameters, content will pass {} |
Sample input
{
"system":{
"ver":"1.0",
"appId":"lcdxxxxxxxxxxxxxxx",
"sign":"58386675a58cf164d64c1944fd33a516",
"time":1603366491,
"nonce":"7aed0429-1a92-4a51-b8b0-cfebb60dcc85"
},
"id":"a25f887f-33f0-44ef-9ed3-f60f83193482",
"params":{
"token":"At_00000xxxxxxxxxxxxxxxxxx",
"productId": "W8ql32289",
"deviceId": "TESTQWERXXXX",
"ref":"123456",
"content": {
"3302": 30,
"3301": 0
}
}
}
Return data field description
| Field name | Field type | Field description | |
|---|---|---|---|
| content | outputData | String | Method return value, please refer to "4. Imou Cloud Things Data Model Format" in IoT things data model for detailed field meanings. |
| service | String | project name | |
Sample output
{
"result": {
"msg": "Operation is successful.",
"code": "0",
"data": {
"content": {
"outputData": {},
"service": "21600"
}
}
},
"id": "a25f887f-33f0-44ef-9ed3-f60f83193482"
}
