获取产品信息

最近更新时间:2024-10-11 18:02:12

我的收藏

1. 接口描述

接口请求域名:iot.cloud.tencent.com/api/exploreropen/tokenapi。 本接口(AppGetProducts)获取产品信息。

2. 输入参数

名称
类型
必选
描述
AccessToken
String
公共参数,AccessToken 用于对一个已经登录的用户鉴权。
RequestId
String
公共参数,唯一请求 ID,可自行生成,推荐使用 uuid。定位问题时,需提供该次请求的 RequestId。
Action
String
公共参数,本接口取值:AppGetProducts。
ProductIds
Array of String
产品 ID 数组。
DeviceIds
Array of String
设备 ID 数组。

3. 输出参数

名称
类型
描述
Products
返回产品信息。
RequestId
String
公共参数,唯一请求 ID,与入参相同。

4. 示例

输入示例
POST https://iot.cloud.tencent.com/api/exploreropen/tokenapi HTTP/1.1
content-type: application/json
{
"AccessToken": "8b4a70dd16105f******************18edd4e78a3bb8ec",
"RequestId": "27HPvi1ylv",
"Action": "AppGetProducts",
"ProductIds":["FVYYYEL4ON"],
"DeviceIds":["QDA1PZLBNB/aaa", "QDA1PZLBNB/bbb"]
}

输出示例: 成功
{
"Response":{
"Products":[
{
"ProductId":"FVYYYEL4ON",
"Name":"c1",
"Description":"yes",
"State":"",
"DataTemplate":"{"version":"1.0","profile":{"ProductId":"FVYYYEL4ON","CategoryId":"1"},"properties":[{"id":"mac","name":"mac地址","desc":"wifi路由器mac地址","required":true,"mode":"r","define":{"type":"string","min":"0","max":"30"}},{"id":"signal","name":"wifi强度","desc":"wifi信号强度值","mode":"r","define":{"type":"int","unit":"dbm","step":"1","min":"-180","max":"180","start":"1"}},{"id":"ssid","name":"wifi热点名","desc":"设备连接的wifi热点名","mode":"r","define":{"type":"string","min":"0","max":"64"}},{"id":"severip","name":"wifi路由器接入的ip","desc":"wifi路由器接入的ip","mode":"r","define":{"type":"string","min":"0","max":"64"}},{"id":"nmacs","name":"其他热点mac地址","desc":"可接受到的其他热点mac地址","mode":"r","define":{"type":"string","min":"0","max":"64"}}],"events":[],"actions":[]}",
"AppTemplate":"",
"NetType":"wifi",
"CategoryId":1,
"ProductType":0,
"UpdateTime":1600159203
},
{
"ProductId":"QDA1PZLBNB",
"Name":"light5勿删",
"Description":"",
"State":"",
"DataTemplate":"{"version":"1.0","profile":{"ProductId":"QDA1PZLBNB","CategoryId":"141"},"properties":[{"id":"power_switch","name":"电灯开关","desc":"控制电灯开灭","required":true,"mode":"rw","define":{"type":"bool","mapping":{"0":"","1":""}}},{"id":"color","name":"颜色","desc":"灯光颜色","mode":"rw","define":{"type":"enum","mapping":{"0":"Red","1":"Green","2":"Blue"}}},{"id":"brightness","name":"亮度","desc":"灯光亮度","mode":"rw","define":{"type":"int","unit":"%","step":"1","min":"0","max":"100","start":"1"}},{"id":"name","name":"灯位置名称","desc":"灯位置名称:书房、客厅等","mode":"rw","required":false,"define":{"type":"string","min":"0","max":"64"}},{"id":"Temperature","name":"温度","desc":"","mode":"rw","define":{"type":"float","min":"0","max":"100","start":"0","step":"1","unit":""},"required":false},{"id":"temp_max","name":"最高温度","desc":"","mode":"rw","define":{"type":"int","min":"0","max":"100","start":"0","step":"1","unit":""},"required":false},{"id":"LBS_BS","name":"LBS_BS","desc":"","mode":"rw","define":{"type":"string","min":"0","max":"2048"},"required":false},{"id":"FOO","name":"FOO","desc":"","mode":"rw","define":{"type":"string","min":"0","max":"2048"},"required":false},{"id":"GPS_Ext","name":"GPS_Ext","desc":"","mode":"rw","define":{"type":"string","min":"0","max":"2048"},"required":false}],"events":[{"id":"status_report","name":"DeviceStatus","desc":"Report the device status","type":"info","required":false,"params":[{"id":"status","name":"running_state","desc":"Report current device running state","define":{"type":"bool","mapping":{"0":"normal","1":"fault"}}},{"id":"message","name":"Message","desc":"Some extra message","define":{"type":"string","min":"0","max":"64"}}]},{"id":"low_voltage","name":"LowVoltage","desc":"Alert for device voltage is low","type":"alert","required":false,"params":[{"id":"voltage","name":"Voltage","desc":"Current voltage","define":{"type":"float","unit":"V","step":"1","min":"0.0","max":"24.0","start":"1"}}]},{"id":"hardware_fault","name":"Hardware_fault","desc":"Report hardware fault","type":"fault","required":false,"params":[{"id":"name","name":"Name","desc":"Name like: memory,tf card, censors ...","define":{"type":"string","min":"0","max":"64"}},{"id":"error_code","name":"Error_Code","desc":"Error code for fault","define":{"type":"int","unit":"","step":"1","min":"0","max":"2000","start":"1"}}]}],"actions":[]}",
"AppTemplate":"",
"NetType":"else",
"CategoryId":141,
"ProductType":0,
"UpdateTime":1600265188
},
{
"ProductId":"QDA1PZLBNB",
"Name":"light5勿删",
"Description":"",
"State":"",
"DataTemplate":"{"version":"1.0","profile":{"ProductId":"QDA1PZLBNB","CategoryId":"141"},"properties":[{"id":"power_switch","name":"电灯开关","desc":"控制电灯开灭","required":true,"mode":"rw","define":{"type":"bool","mapping":{"0":"","1":""}}},{"id":"color","name":"颜色","desc":"灯光颜色","mode":"rw","define":{"type":"enum","mapping":{"0":"Red","1":"Green","2":"Blue"}}},{"id":"brightness","name":"亮度","desc":"灯光亮度","mode":"rw","define":{"type":"int","unit":"%","step":"1","min":"0","max":"100","start":"1"}},{"id":"name","name":"灯位置名称","desc":"灯位置名称:书房、客厅等","mode":"rw","required":false,"define":{"type":"string","min":"0","max":"64"}},{"id":"Temperature","name":"温度","desc":"","mode":"rw","define":{"type":"float","min":"0","max":"100","start":"0","step":"1","unit":""},"required":false},{"id":"temp_max","name":"最高温度","desc":"","mode":"rw","define":{"type":"int","min":"0","max":"100","start":"0","step":"1","unit":""},"required":false},{"id":"LBS_BS","name":"LBS_BS","desc":"","mode":"rw","define":{"type":"string","min":"0","max":"2048"},"required":false},{"id":"FOO","name":"FOO","desc":"","mode":"rw","define":{"type":"string","min":"0","max":"2048"},"required":false},{"id":"GPS_Ext","name":"GPS_Ext","desc":"","mode":"rw","define":{"type":"string","min":"0","max":"2048"},"required":false}],"events":[{"id":"status_report","name":"DeviceStatus","desc":"Report the device status","type":"info","required":false,"params":[{"id":"status","name":"running_state","desc":"Report current device running state","define":{"type":"bool","mapping":{"0":"normal","1":"fault"}}},{"id":"message","name":"Message","desc":"Some extra message","define":{"type":"string","min":"0","max":"64"}}]},{"id":"low_voltage","name":"LowVoltage","desc":"Alert for device voltage is low","type":"alert","required":false,"params":[{"id":"voltage","name":"Voltage","desc":"Current voltage","define":{"type":"float","unit":"V","step":"1","min":"0.0","max":"24.0","start":"1"}}]},{"id":"hardware_fault","name":"Hardware_fault","desc":"Report hardware fault","type":"fault","required":false,"params":[{"id":"name","name":"Name","desc":"Name like: memory,tf card, censors ...","define":{"type":"string","min":"0","max":"64"}},{"id":"error_code","name":"Error_Code","desc":"Error code for fault","define":{"type":"int","unit":"","step":"1","min":"0","max":"2000","start":"1"}}]}],"actions":[]}",
"AppTemplate":"",
"NetType":"else",
"CategoryId":141,
"ProductType":0,
"UpdateTime":1600265188
}
],
"RequestId":"27HPvi1ylv"
}
}

5. 错误码

错误码
描述
InternalError
内部错误。
InvalidParameterValue
参数取值错误。
InvalidParameterValue.InvalidAccessToken
Token 无效。