请求物模型中Service方法
# iotDeviceControl:请求物模型中Service方法
# 功能详情
通过物模型操作设备物模型中指定Service方法
# 请求地址
https://openapi.lechange.cn/openapi/iotDeviceControl
# 传入参数说明
参数名 | 参数类型 | 是否必填 | 默认值 | 合法值 | 参数说明 |
---|---|---|---|---|---|
token | String | 是 | 管理员或者子账户accessToken | ||
productId | String | 是 | 产品id即为listDeviceDetailsByIds、listDeviceDetailsByPage查询设备列表接口中的返回值productId,若列表返回的productId字段有值,即代表该设备为IoT设备,支持调用IoT物模型相关协议 | 设备产品id | |
deviceId | String | 是 | 设备序列号 | ||
ref | String | 是 | 物模型service的ref值 | ||
content | [Object] | 是 | 通过获取产品物模型查看设备支持的Service方法 | 物模型中service对应的方法及入参,格式为"content":{"service中ref1":"value值1","service中refN":"value值N"}。若service对应方法无入参,content传{} |
# 样例输入
{
"system":{
"ver":"1.0",
"appId":"lcdxxxxxxxxx",
"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
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 返回参数说明
字段名 | 字段类型 | 字段说明 | |
---|---|---|---|
content | outputData | String | 方法返回值,详细字段含义请参考IoT物模型概述中"四、乐橙云IoT物模型模板"的完整物模型模板 |
service | String | 项目名称 |
# 样例输出
{
"result": {
"msg": "操作成功。",
"code": "0",
"data": {
"content": {
"outputData": {},
"service": "21600"
}
}
},
"id": "a25f887f-33f0-44ef-9ed3-f60f83193482"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13