园区业务中获取设备所属空间
| 路径 | /campus/paas/openapi/space/by/device/query |
| 版本号 | 1.0.0 |
| 协议 | HTTPS |
| 请求方法 | POST |
| 是否需要用户身份鉴权 | 否 |
| 超时时间 | 10000 |
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| appId | String | 否 | 统一应用id | |
| iotId | String | 是 | 设备标识 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| code | Int |
响应码, 200: 成功 |
|
| message | String |
错误消息 |
|
| localizedMsg | String |
本地语言错误消息 |
|
| data | JSON |
响应结果 |
|
| spaceId | String |
空间id |
|
| attribute | String |
空间属性 |
|
| gmtCreate | Long |
创建时间 |
|
| creatorType | String |
创建人类型 |
|
| creatorId | String |
创建人ID |
|
| gmtModified | Long |
更新时间 |
|
| modifierType | String |
修改人类型 |
|
| modifierId | String |
修改人ID |
|
| creatorNickName | String |
如果创建人是identityId,则有值 |
|
| modifierNickName | String |
如果修改人是identityId,则有值 |
|
| parentId | String |
上级空间id |
|
| businessId | String |
业务空间id |
|
| name | String |
空间名称 |
|
| path | String |
空间路径 /pid/pid/pid/pid/ |
|
| description | String |
空间描述 |
|
| typeCode | String |
空间类型代码 |
|
| usesCode | String |
空间用途代码 |
|
| usesName | String |
空间用途名称 |
|
| typeName | String |
空间类型名称 |
|
| geoDTO | JSON |
空间geo |
|
| length | String |
空间长度,单位m |
|
| width | String |
空间宽度,单位m |
|
| altitude | String |
空间高度,单位m |
|
| area | String |
空间面积,单位m² |
|
| volume | String |
空间体积,单位m³ |
|
| poiCode | String |
空间编码不含父子级 |
|
| bizType | String |
业务类型home / campus |
|
| poiCodePath | String |
空间编码含父子级 |
|
| hasChild | Boolean |
是否有下级空间节点 |
|
| hasDeviceChild | Int |
空间是否包含设备,1: 有; 0: 无 |
|
| status | Int |
空间状态 1:启用;0:停用; |
|
| spaceScope | Int |
0:公用;1:私有; |
|
| namePath | String |
空间路径名称 |
|
| typeCodePath | String |
空间路径code ex. /building/unit/floor/house/ |
示例
请求示例
{
"id": "1509086454180",
"version": "1.0",
"request":{
"apiVer": "1.0.0"
},
"params":{
"appId": "value0",
"iotId": "value1"
}
}
正常返回示例
JSON 格式
{
"id": "4de2c367-c1db-417c-aa15-8c585e595d92",
"code": 200,
"message": null,
"localizedMsg": null,
"data": {
"spaceId":"acgdh*****390ojhjkldj",
"attribute":{
"direction":"east"
},
"gmtCreate":"2019-02-22 12:22:22",
"gmtModified":"2019-02-22 12:22:22",
"parentId":"sjfhu*****ibisdf27890oijhjk",
"businessId":"a3468*****kj",
"name":"我的家",
"path":"/sjfhu*****ibisdf27890oijhjk/acgd*****8390ojhjkldj/",
"hasChild":false,
"hasDeviceChild":1,
"status":1,
"spaceScope":1,
"namePath":"/公寓/我的家"
}
}
异常返回示例
JSON 格式
{
"id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
"code": 403,
"message": "request forbidden.",
"localizedMsg": "请求被禁止",
"data": null
}
错误码
| 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已经失效 |
| 200 | 460 | identityIds need between 1-50 | 入参错误 |
| 200 | 460 | identityIds need between 1-50 | 入参错误 |
| 200 | 403 | request forbidden. | 请求被禁止 |
| 200 | 403 | request forbidden. | 请求被禁止 |