Skip to content

QueryScenes

调用该接口查询场景规则。

使用说明

无。

接口地址

/gateway/openapi

请求方式

POST

请求参数

请求头

名称类型描述
tokenauthorizationString平台颁发的token
apiCodeString固定值:queryScenes

QueryScenesRequest

名称类型是否必选描述
scenesIdString场景id

返回数据

QueryScenesResponse

名称类型描述
codeString调用成功,返回0,调用失败,查看错误信息。
msgString调用成功,提示"操作成功",调用失败,查看错误信息。
dataObject返回结果。结果内容详情,查看下方示例。

示例

请求示例

json
{
    "scenesId":"cacfc113e07563fe8cd1864cdcd2f9b9"
}

返回示例

json
{
    "code": "0",
    "msg": "操作成功",
    "data": {
        "scenesId": "4865c417e47268ee9f54213e8136a997",
        "name": "属性命令测试",
        "conditionLogic": "or",
        "conditionRuleList": [
            {
                "id": "6bccb61a4e184b1a93cd2ddde262a151",
                "type": "property",
                "productKey": "f3NT5tT6t",
                "deviceName": "wubei001",
                "data": [
                    {
                        "pid": "humidity",
                        "name": "湿度",
                        "compare": ">",
                        "compareValue": 50
                    }
                ],
                "tenantId": "T0057",
                "productDevice": {
                    "productKey": "f3NT5tT6t",
                    "deviceName": "wubei001",
                    "deviceId": null,
                    "productDeviceStr": "f3NT5tT6t&wubei001"
                }
            }
        ],
        "actionRuleList": [
            {
                "productKey": "f3NT5tT6t",
                "deviceName": "wubei001",
                "pid": "temperature",
                "commandId": "e8830ea9dfa040efbaab6694018ebc2b",
                "type": "property",
                "data": {
                    "temperature": 12
                }
            },
            {
                "productKey": "f3NT5tT6t",
                "deviceName": "wubei001",
                "pid": "setM1",
                "commandId": "9de767c9c4e24e55838c0d6778bf4096",
                "type": "command",
                "data": {
                    "c1": 34,
                    "c2": "sd湿哒哒"
                }
            }
        ]
    }
}

错误码

错误码错误码取值解决方案
iot.scenes.notExist场景不存在。请传入正确的场景id。