获取项目下所有已绑定空间的设备信息
| 路径 | /campus/paas/openapi/space/device/list |
| 版本号 | 1.8.0 |
| 协议 | HTTPS |
| 请求方法 | POST |
| 是否需要用户身份鉴权 | 否 |
| 超时时间 | 10000 |
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| appId | String | 否 | d64fff*****34e8d9bf40a16065d59b3 | 应用实例唯一id |
| pageNo | Int | 是 | 1 | 当前页码 |
| pageSize | Int | 是 | 1 | 每页条数 |
| categoryKey | String | 否 | 产品分类key | |
| spaceId | String | 否 | 空间ID过滤条件,搜索当前空间及所有下级空间 | |
| match | String | 否 | match为true 就是返回这个空间下的数据 如果为false或者不传,则查当前空间以及子空间下的所有设备 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| code | Int |
响应码, 200: 成功 |
|
| message | String |
错误消息 |
|
| localizedMsg | String |
本地语言错误消息 |
|
| data | JSON |
返回结果数据 |
|
| total | Long |
总条数 |
|
| pageNo | Long |
当前页码 |
|
| pageSize | Long |
每页条数 |
|
| data | JSON |
结果集合 |
|
| productName | String |
产品名称 |
|
| productKey | String |
产品productKey |
|
| deviceName | String |
设备deviceName |
|
| categoryKey | String |
设备类型(如Gateway代表网关) |
|
| namePath | String |
设备绑定空间位置 |
|
| iotId | String |
设备id |
|
| path | String |
空间id的路径 |
|
| spaceId | String |
空间id |
|
| deviceStatus | String |
设备状态:0
|
|
| memoName | String |
设备备注名 |
示例
请求示例
{
"id": "1509086454180",
"version": "1.0",
"request":{
"apiVer": "1.8.0"
},
"params":{
"appId": "d64fff*****34e8d9bf40a16065d59b3",
"pageNo":1,
"pageSize":1,
"categoryKey": "value3",
"spaceId": "value4",
"match": "value5"
}
}
正常返回示例
JSON 格式
{
"code": 200,
"data": {
"data": [
{
"categoryKey": "Gateway",
"deviceName": "xxxx*****x",
"productKey": "xxxx*****x",
"productName": "xxxxx*****",
"spacePath": "/xxxxxxxxxx/xxxxxxxxxx/"
},
{
"categoryKey": "Curtain",
"deviceName": "xxxxx*****",
"productKey": "xxxxx*****",
"productName": "xxxxx*****",
"spacePath": "/xxxxx*****/xxxxx*****/"
}
],
"pageNo": 1,
"pageSize": 20,
"total": 100
},
"message": "success"
}
异常返回示例
JSON 格式
{
"code": 28402,
"localizedMsg": "无权访问该项目",
"message": "no access to the project"
}
错误码
| HttpCode | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 500 | 500 | Internal Error | Internal Error |
| 503 | 503 | Service Unavailable | Service Unavailable |
| 403 | 403 | Request Limited | Request Limited |
| 401 | 401 | Empty Signature | Empty Signature |
| 400 | 400 | Request Format Error | Request Format Error |
| 200 | 20003 | Find Backend Error | Find Backend Error |
| 200 | 20004 | Backend Service Error | Backend Service Error |
| 200 | 20055 | Backend Service Invalid | Request Format Error |
| 200 | 20056 | Hsf Invoke Timeout | Hsf Invoke Timeout |
| 200 | 401 | Request Authorized Error | Request Authorized Error |
| 200 | 403 | Request Forbidden | Request Forbidden |
| 200 | 500 | Server Error | Server Error |
| 200 | 2459 | oa error message | 会话Id不存在 |
| 200 | 2459 | oa error message | 会话Id不存在 |
| 200 | 2402 | iotToken not exist | |
| 200 | 2402 | iotToken not exist | |
| 200 | 2401 | refreshToken invalid | refreshToken已经失效 |
| 200 | 2401 | refreshToken invalid | refreshToken已经失效 |