调用该接口查询家中的场景列表,支持天气质量条件查询。
| 路径 | /living/scene/query |
| 版本号 | 1.0.1 |
| 协议 | HTTPS |
| 请求方法 | POST |
| 是否需要用户身份鉴权 | 是 |
| 超时时间 | 10000 |
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| catalogId | String | 是 | 0 | 场景的类型。取值为:0 (表示手动场景);1 (表示自动化场景)。 |
| pageNo | Int | 是 | 分页页码,从 1 开始。 | |
| pageSize | Int | 是 | 分页大小。取值范围:1~30。 | |
| type | String | 否 | 业务类型,ilop或 hc。 | |
| homeId | String | 是 | 123 | 场景所在家的 ID,生活物联网平台赋予家的唯一标识符。 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| code | Int |
接口返回码。200表示成功。 |
|
| message | String |
调用失败时,返回的出错信息。 |
|
| localizedMsg | String |
本地语言的错误消息。 |
|
| data | JSON |
响应结果。 |
|
| total | Int |
总条数目。 |
|
| scenes | JSON |
返回当前页条目。 |
|
| id | String |
场景的ID。 |
|
| status | Int |
场景运行状态。取值为:1(表示场景上线);2(表示场景下线)。 |
|
| enable | Boolean |
App上场景开关。取值为:true(表示场景置为打开);false(表示场景置为关闭)。 |
|
| icon | String |
场景图标链接。 |
|
| name | String |
场景的名称。 |
|
| description | String |
场景的描述。 |
|
| iconColor | String |
场景图标的颜色。 |
|
| valid | Boolean |
场景是否有效。 |
|
| catalogId | String |
场景的类型。null(表示老版场景); 0(表示手动场景);1(表示自动化场景)。 |
|
| pageNo | Int |
分页页码,从 1 开始。 |
|
| pageSize | Int |
分页大小,取值范围:1~50。 |
示例
请求示例
{
"id": "1509086454180",
"version": "1.0",
"request":{
"apiVer": "1.0.1",
"iotToken": "token"
},
"params":{
"catalogId": "0",
"pageNo": "value1",
"pageSize": "value2",
"type": "value3",
"homeId": "123"
}
}
正常返回示例
JSON 格式
{
"code": 200,
"data": {
"pageNo": 1,
"pageSize": 20,
"scenes": [{
"description": "电热毯-hy-信噪比--127 ",
"enable": true,
"icon": "https://g.aliplus.com/scene_icons/default.png",
"id": "260de82dxxxx691be22",
"name": "电热毯",
"status": 2,
"iconColor":"#19BBFF",
"valid":false,
"catalogId":"1"
}, {
"description": "light-hy-LightSwitch-1, shuijin-hy-WiFI_SNR--127 ",
"enable": true,
"icon": "https://g.aliplus.com/scene_icons/default.png",
"id": "45dc6fcxxxx6974e5f7",
"name": "凉宫",
"status": 1,
"iconColor":"#19BBFF",
"valid":true,
"catalogId":"1"
}, {
"description": "fengsan-hy-PowerSwitch-关闭, light-hy-LightSwitch-1 ",
"enable": true,
"icon": "https://g.aliplus.com/scene_icons/default.png",
"id": "3ce636xxxx1367f2dc88",
"name": "风扇灯0522",
"status": 1,
"iconColor":"#19BBFF",
"valid":false,
"catalogId":"1"
}, {
"description": "light-hy-LightSwitch-1 ",
"enable": true,
"icon": "https://g.aliplus.com/scene_icons/default.png",
"id": "5b4bdexxxx2612f81",
"name": "灯0522",
"status": 2,
"iconColor":"#19BBFF",
"valid":false,
"catalogId":"1"
}],
"total": 4
},
"message": "success"
}
异常返回示例
JSON 格式
{
"id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
"code": 403,
"message": "request forbidden.",
"localizedMsg": "请求被禁止",
"data": null
}