调用该接口根据过滤规则,从客户端通过本地通讯发现的本地设备列表中过滤出还未被用户绑定的设备信息。
路径 | /awss/enrollee/product/filter |
版本号 | 1.0.8 |
协议 | HTTP,HTTPS |
请求方法 | POST |
是否需要用户身份鉴权 | 是 |
超时时间 | 15000 |
请求参数
名称 | 位置 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
iotDevices | List | 是 | [{"productKey":"pk1","deviceName":"dn1"},{"productKey":"pk2","deviceName":"dn2"}] | 本地发现的设备信息列表。 | |
productKey | String | 是 | a1h****aDXE | 产品的Key,设备证书信息之一。创建产品时,生活物联网平台为该产品颁发的全局唯一标识。 | |
deviceName | String | 否 | 23FS90G****GJWWEGR | 设备的名称,设备证书信息之一。在注册设备时,自定义的或系统生成的设备名称,具备产品维度内的唯一性。 | |
reset | Boolean | 否 | reset标记。true(不过滤已经绑定的该设备);false(过滤已经绑定的该设备)。 | ||
productStatusEnv | String | 否 | release | 产品状态。dev(表示产品开发中);release(表示产品已发布)。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
code | Int |
接口返回码。200表示成功。 |
|
message | String |
调用失败时,返回的出错信息。 |
|
localizedMsg | String |
本地语言的错误信息。 |
|
data | JSON |
返回的产品信息。 |
|
productKey | String |
产品的Key。 |
|
deviceName | String |
设备名称。 |
|
token | String |
设备上传的生活物联网平台Token。 |
|
productName | String |
产品名称。 |
|
netType | Int |
产品入网类型:0(表示LoRa);3(表示WiFi);4(表示ZigBee);5(表示Bluetooth);6(表示蜂窝网);7(表示以太网);8(表示其他入网方式)。 |
|
nodeType | Int |
节点类型。0(表示设备);1(表示网关)。 |
|
categoryKey | String |
产品所属品类的品类标识符。 |
|
categoryName | String |
产品所属品类的名称。 |
|
categoryId | Long |
产品归属品类的ID。 |
|
image | String |
产品图标URL。 |
示例
请求示例
// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();
ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");
SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);
IoTApiRequest request = new IoTApiRequest();
// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.8");
// 如果需要登陆,设置当前的会话的token,token通过登录api获取
request.setIotToken("你的<IoTToken>");
// 设置参数
request.putParam("iotDevices", "value0");
request.putParam("productStatusEnv", value1");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");
// 设置请求参数域名, path, request, isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/awss/enrollee/product/filter", request, true, headers);
System.out.println(
"response code = " + response.getCode()
+ " response = " + new String(response.getBody(), "UTF-8")
+ " headers = " + response.getHeaders().toString()
);
正常返回示例
JSON
格式
{
"code": 200,
"data":[{
"productKey":"a1v12d34vm",
"deviceName":"xxxxxx",
"netType":3,
"nodeType":0,
"categoryKey":"xxx",
"categoryName":"xxx",
"categoryId":14
}
],
"message": "success"
}
异常返回示例
JSON
格式
{
"id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
"code": 403,
"message": "request forbidden.",
"localizedMsg": "请求被禁止",
"data": null
}
在文档使用中是否遇到以下问题
更多建议
匿名提交