物的模型服务

更新时间:2018-09-05 19:28:29

获取物的属性

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/properties/get 1.0.1 获取物的所有属性快照数据

请求参数

参数 类型 必填 描述
iotId String 物的标识符

返回参数

参数 子健 子健 类型 描述
data array 属性
identifier 属性标识符
value Object 属性对应的数据
time Long 属性采集时间

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697"
    }
}

正常返回示例

{
  "code": 200,
  "data": {
    "_sys_device_mid": {
      "time": 1516356290173,
      "value": "example.demo.module-id"
    },
    "WorkMode": {
      "time": 1516347450295,
      "value": 0
    },
    "_sys_device_pid": {
      "time": 1516356290173,
      "value": "example.demo.partner-id"
    }
  },
  "message": "success",
  "localizedMsg": null
}

错误码

错误码 错误信息 详细描述

获取物的模板

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/tsl/get 1.0.1 获取物的tsl功能(包含属性、事件、服务的定义)模板

请求参数

参数 类型 必填 描述
iotId String 物的唯一标识符

返回参数

参数 类型 描述

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697"
    }
}

正常返回示例

{
    "code": 200,
    "data": {
        "schema": "http://aliyun/iot/thing/desc/schema",
        "profile": {
            "productKey": "a1xqv8AGpck",
            "deviceName": "YzqEnI5DY03rxLS2pjjo"
        },
        "link": "/sys/a1xqv8AGpck/YzqEnI5DY03rxLS2pjjo/thing/",
        "services": [
            {
                "outputData": [

                ],
                "identifier": "set",
                "inputData": [
                    {
                        "identifier": "LightSwitch",
                        "dataType": {
                            "specs": {
                                "0": "关闭",
                                "1": "开启"
                            },
                            "type": "bool"
                        },
                        "name": "主灯开关"
                    },
                    {
                        "identifier": "ColorTemperature",
                        "dataType": {
                            "specs": {
                                "unit": "K",
                                "min": "2700",
                                "unitName": "开尔文",
                                "max": "6500"
                            },
                            "type": "int"
                        },
                        "name": "冷暖色温"
                    },
                    {
                        "identifier": "Brightness",
                        "dataType": {
                            "specs": {
                                "unit": "%",
                                "min": "0",
                                "unitName": "百分比",
                                "max": "100"
                            },
                            "type": "int"
                        },
                        "name": "明暗度"
                    },
                    {
                        "identifier": "HSVColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Hue",
                                    "dataType": {
                                        "specs": {
                                            "unit": "°",
                                            "min": "0",
                                            "unitName": "度",
                                            "max": "360"
                                        },
                                        "type": "int"
                                    },
                                    "name": "色调"
                                },
                                {
                                    "identifier": "Saturation",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "饱和度"
                                },
                                {
                                    "identifier": "Value",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "明度"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "HSV调色"
                    },
                    {
                        "identifier": "HSLColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Hue",
                                    "dataType": {
                                        "specs": {
                                            "unit": "°",
                                            "min": "0",
                                            "unitName": "度",
                                            "max": "360"
                                        },
                                        "type": "int"
                                    },
                                    "name": "色调"
                                },
                                {
                                    "identifier": "Saturation",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "饱和度"
                                },
                                {
                                    "identifier": "Lightness",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "亮度"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "HSL调色"
                    },
                    {
                        "identifier": "RGBColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Red",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "红色"
                                },
                                {
                                    "identifier": "Green",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "绿色"
                                },
                                {
                                    "identifier": "Blue",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "蓝色"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "RGB调色"
                    },
                    {
                        "identifier": "NightLightSwitch",
                        "dataType": {
                            "specs": {
                                "0": "关闭",
                                "1": "开启"
                            },
                            "type": "bool"
                        },
                        "name": "夜灯开关"
                    },
                    {
                        "identifier": "WorkMode",
                        "dataType": {
                            "specs": {
                                "0": "手动",
                                "1": "阅读",
                                "2": "影院",
                                "3": "夜灯",
                                "4": "生活",
                                "5": "柔和"
                            },
                            "type": "enum"
                        },
                        "name": "工作模式"
                    }
                ],
                "method": "thing.service.property.set",
                "name": "set",
                "required": true,
                "callType": "sync",
                "desc": "属性设置"
            },
            {
                "outputData": [
                    {
                        "identifier": "LightSwitch",
                        "dataType": {
                            "specs": {
                                "0": "关闭",
                                "1": "开启"
                            },
                            "type": "bool"
                        },
                        "name": "主灯开关"
                    },
                    {
                        "identifier": "ColorTemperature",
                        "dataType": {
                            "specs": {
                                "unit": "K",
                                "min": "2700",
                                "unitName": "开尔文",
                                "max": "6500"
                            },
                            "type": "int"
                        },
                        "name": "冷暖色温"
                    },
                    {
                        "identifier": "Brightness",
                        "dataType": {
                            "specs": {
                                "unit": "%",
                                "min": "0",
                                "unitName": "百分比",
                                "max": "100"
                            },
                            "type": "int"
                        },
                        "name": "明暗度"
                    },
                    {
                        "identifier": "HSVColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Hue",
                                    "dataType": {
                                        "specs": {
                                            "unit": "°",
                                            "min": "0",
                                            "unitName": "度",
                                            "max": "360"
                                        },
                                        "type": "int"
                                    },
                                    "name": "色调"
                                },
                                {
                                    "identifier": "Saturation",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "饱和度"
                                },
                                {
                                    "identifier": "Value",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "明度"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "HSV调色"
                    },
                    {
                        "identifier": "HSLColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Hue",
                                    "dataType": {
                                        "specs": {
                                            "unit": "°",
                                            "min": "0",
                                            "unitName": "度",
                                            "max": "360"
                                        },
                                        "type": "int"
                                    },
                                    "name": "色调"
                                },
                                {
                                    "identifier": "Saturation",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "饱和度"
                                },
                                {
                                    "identifier": "Lightness",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "亮度"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "HSL调色"
                    },
                    {
                        "identifier": "RGBColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Red",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "红色"
                                },
                                {
                                    "identifier": "Green",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "绿色"
                                },
                                {
                                    "identifier": "Blue",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "蓝色"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "RGB调色"
                    },
                    {
                        "identifier": "NightLightSwitch",
                        "dataType": {
                            "specs": {
                                "0": "关闭",
                                "1": "开启"
                            },
                            "type": "bool"
                        },
                        "name": "夜灯开关"
                    },
                    {
                        "identifier": "WorkMode",
                        "dataType": {
                            "specs": {
                                "0": "手动",
                                "1": "阅读",
                                "2": "影院",
                                "3": "夜灯",
                                "4": "生活",
                                "5": "柔和"
                            },
                            "type": "enum"
                        },
                        "name": "工作模式"
                    }
                ],
                "identifier": "get",
                "inputData": [
                    "LightSwitch",
                    "ColorTemperature",
                    "Brightness",
                    "HSVColor",
                    "HSLColor",
                    "RGBColor",
                    "NightLightSwitch",
                    "WorkMode"
                ],
                "method": "thing.service.property.get",
                "name": "get",
                "required": true,
                "callType": "sync",
                "desc": "属性获取"
            },
            {
                "outputData": [

                ],
                "identifier": "ToggleLightSwitch",
                "inputData": [

                ],
                "method": "thing.service.ToggleLightSwitch",
                "name": "翻转主灯开关",
                "required": false,
                "callType": "async"
            }
        ],
        "properties": [
            {
                "identifier": "LightSwitch",
                "dataType": {
                    "specs": {
                        "0": "关闭",
                        "1": "开启"
                    },
                    "type": "bool"
                },
                "name": "主灯开关",
                "accessMode": "rw",
                "required": true
            },
            {
                "identifier": "ColorTemperature",
                "dataType": {
                    "specs": {
                        "unit": "K",
                        "min": "2700",
                        "unitName": "开尔文",
                        "max": "6500"
                    },
                    "type": "int"
                },
                "name": "冷暖色温",
                "accessMode": "rw",
                "required": false
            },
            {
                "identifier": "Brightness",
                "dataType": {
                    "specs": {
                        "unit": "%",
                        "min": "0",
                        "unitName": "百分比",
                        "max": "100"
                    },
                    "type": "int"
                },
                "name": "明暗度",
                "accessMode": "rw",
                "required": false
            },
            {
                "identifier": "HSVColor",
                "dataType": {
                    "specs": [
                        {
                            "identifier": "Hue",
                            "dataType": {
                                "specs": {
                                    "unit": "°",
                                    "min": "0",
                                    "unitName": "度",
                                    "max": "360"
                                },
                                "type": "int"
                            },
                            "name": "色调"
                        },
                        {
                            "identifier": "Saturation",
                            "dataType": {
                                "specs": {
                                    "unit": "%",
                                    "min": "0",
                                    "unitName": "百分比",
                                    "max": "100"
                                },
                                "type": "int"
                            },
                            "name": "饱和度"
                        },
                        {
                            "identifier": "Value",
                            "dataType": {
                                "specs": {
                                    "unit": "%",
                                    "min": "0",
                                    "unitName": "百分比",
                                    "max": "100"
                                },
                                "type": "int"
                            },
                            "name": "明度"
                        }
                    ],
                    "type": "struct"
                },
                "name": "HSV调色",
                "accessMode": "rw",
                "required": false
            },
            {
                "identifier": "HSLColor",
                "dataType": {
                    "specs": [
                        {
                            "identifier": "Hue",
                            "dataType": {
                                "specs": {
                                    "unit": "°",
                                    "min": "0",
                                    "unitName": "度",
                                    "max": "360"
                                },
                                "type": "int"
                            },
                            "name": "色调"
                        },
                        {
                            "identifier": "Saturation",
                            "dataType": {
                                "specs": {
                                    "unit": "%",
                                    "min": "0",
                                    "unitName": "百分比",
                                    "max": "100"
                                },
                                "type": "int"
                            },
                            "name": "饱和度"
                        },
                        {
                            "identifier": "Lightness",
                            "dataType": {
                                "specs": {
                                    "unit": "%",
                                    "min": "0",
                                    "unitName": "百分比",
                                    "max": "100"
                                },
                                "type": "int"
                            },
                            "name": "亮度"
                        }
                    ],
                    "type": "struct"
                },
                "name": "HSL调色",
                "accessMode": "rw",
                "required": false
            },
            {
                "identifier": "RGBColor",
                "dataType": {
                    "specs": [
                        {
                            "identifier": "Red",
                            "dataType": {
                                "specs": {
                                    "min": "0",
                                    "unitName": "无",
                                    "max": "255"
                                },
                                "type": "int"
                            },
                            "name": "红色"
                        },
                        {
                            "identifier": "Green",
                            "dataType": {
                                "specs": {
                                    "min": "0",
                                    "unitName": "无",
                                    "max": "255"
                                },
                                "type": "int"
                            },
                            "name": "绿色"
                        },
                        {
                            "identifier": "Blue",
                            "dataType": {
                                "specs": {
                                    "min": "0",
                                    "unitName": "无",
                                    "max": "255"
                                },
                                "type": "int"
                            },
                            "name": "蓝色"
                        }
                    ],
                    "type": "struct"
                },
                "name": "RGB调色",
                "accessMode": "rw",
                "required": false
            },
            {
                "identifier": "NightLightSwitch",
                "dataType": {
                    "specs": {
                        "0": "关闭",
                        "1": "开启"
                    },
                    "type": "bool"
                },
                "name": "夜灯开关",
                "accessMode": "rw",
                "required": false
            },
            {
                "identifier": "WorkMode",
                "dataType": {
                    "specs": {
                        "0": "手动",
                        "1": "阅读",
                        "2": "影院",
                        "3": "夜灯",
                        "4": "生活",
                        "5": "柔和"
                    },
                    "type": "enum"
                },
                "name": "工作模式",
                "accessMode": "rw",
                "required": false
            }
        ],
        "events": [
            {
                "outputData": [
                    {
                        "identifier": "LightSwitch",
                        "dataType": {
                            "specs": {
                                "0": "关闭",
                                "1": "开启"
                            },
                            "type": "bool"
                        },
                        "name": "主灯开关"
                    },
                    {
                        "identifier": "ColorTemperature",
                        "dataType": {
                            "specs": {
                                "unit": "K",
                                "min": "2700",
                                "unitName": "开尔文",
                                "max": "6500"
                            },
                            "type": "int"
                        },
                        "name": "冷暖色温"
                    },
                    {
                        "identifier": "Brightness",
                        "dataType": {
                            "specs": {
                                "unit": "%",
                                "min": "0",
                                "unitName": "百分比",
                                "max": "100"
                            },
                            "type": "int"
                        },
                        "name": "明暗度"
                    },
                    {
                        "identifier": "HSVColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Hue",
                                    "dataType": {
                                        "specs": {
                                            "unit": "°",
                                            "min": "0",
                                            "unitName": "度",
                                            "max": "360"
                                        },
                                        "type": "int"
                                    },
                                    "name": "色调"
                                },
                                {
                                    "identifier": "Saturation",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "饱和度"
                                },
                                {
                                    "identifier": "Value",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "明度"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "HSV调色"
                    },
                    {
                        "identifier": "HSLColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Hue",
                                    "dataType": {
                                        "specs": {
                                            "unit": "°",
                                            "min": "0",
                                            "unitName": "度",
                                            "max": "360"
                                        },
                                        "type": "int"
                                    },
                                    "name": "色调"
                                },
                                {
                                    "identifier": "Saturation",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "饱和度"
                                },
                                {
                                    "identifier": "Lightness",
                                    "dataType": {
                                        "specs": {
                                            "unit": "%",
                                            "min": "0",
                                            "unitName": "百分比",
                                            "max": "100"
                                        },
                                        "type": "int"
                                    },
                                    "name": "亮度"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "HSL调色"
                    },
                    {
                        "identifier": "RGBColor",
                        "dataType": {
                            "specs": [
                                {
                                    "identifier": "Red",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "红色"
                                },
                                {
                                    "identifier": "Green",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "绿色"
                                },
                                {
                                    "identifier": "Blue",
                                    "dataType": {
                                        "specs": {
                                            "min": "0",
                                            "unitName": "无",
                                            "max": "255"
                                        },
                                        "type": "int"
                                    },
                                    "name": "蓝色"
                                }
                            ],
                            "type": "struct"
                        },
                        "name": "RGB调色"
                    },
                    {
                        "identifier": "NightLightSwitch",
                        "dataType": {
                            "specs": {
                                "0": "关闭",
                                "1": "开启"
                            },
                            "type": "bool"
                        },
                        "name": "夜灯开关"
                    },
                    {
                        "identifier": "WorkMode",
                        "dataType": {
                            "specs": {
                                "0": "手动",
                                "1": "阅读",
                                "2": "影院",
                                "3": "夜灯",
                                "4": "生活",
                                "5": "柔和"
                            },
                            "type": "enum"
                        },
                        "name": "工作模式"
                    }
                ],
                "identifier": "post",
                "method": "thing.event.property.post",
                "name": "post",
                "type": "info",
                "required": true,
                "desc": "属性上报"
            },
            {
                "outputData": [
                    {
                        "identifier": "ErrorCode",
                        "dataType": {
                            "specs": {
                                "0": "正常"
                            },
                            "type": "enum"
                        },
                        "name": "故障代码"
                    }
                ],
                "identifier": "Error",
                "method": "thing.event.Error.post",
                "name": "故障上报",
                "type": "info",
                "required": true
            }
        ]
    },
    "message": "success",
    "localizedMsg": null,
    "class": "com.aliyun.iotx.common.base.service.IoTxResult"
}

错误码

错误码 错误信息 详细描述

触发物的服务

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/service/invoke 1.0.1 触发物的服务

请求参数

参数 类型 必填 描述
iotId String 物的标识符
identifier String 服务标识符
args JSON 服务入参

返回参数

参数 类型 描述
​data ​Object ​该返回值类型及值取决于设备端实现逻辑

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697",
        "identifier": "xxxx",
        "args": {}
    }
}

正常返回示例

{
  "code": 200,
  "data": null,
  "message": "success",
  "localizedMsg": ""
}

错误码

错误码 错误信息 详细描述

设置物的属性

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/properties/set 1.0.1 设置物的属性

请求参数

参数 类型 必填 描述
iotId String 物的唯一标识符
items JSON set参数

返回参数

参数 类型 描述

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697",
        "items": {}
    }
}

正常返回示例

{
  "code": 200,
  "data": null,
  "message": "success",
  "localizedMsg": ""
}

错误码

错误码 错误信息 详细描述

获取物的连接状态

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/status/get 1.0.1 获取物的连接状态

请求参数

参数 类型 必填 描述
iotId String

返回参数

参数 类型 描述
status Integer 设备状态 0 - 未激活,1-在线, 3 - 离线, 8 - 禁用
time Long 状态变更时间

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697"
    }
}

正常返回示例

{
  "code": 200,
  "data": {
    "time": 1517923297000,
    "status": 3
  },
  "message": "success",
  "localizedMsg": null,
}

错误码

错误码 错误信息 详细描述

获取物的基本信息

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/info/get 1.0.1 获取物的基本信息

请求参数

参数 类型 必填 描述
iotId String 物的唯一标识符

返回参数

参数 类型 描述
gmtModified Long 数据修改时间
activeTime Long 设备激活时间
gmtCreate Long 设备创建时间
productKey String 产品key
statusLast Integer 上一次设备状态
mac String mac地址
deviceSecret String 设备secret
iotId String 设备唯一标识符
name String 设备名称
nickname String 设备昵称
sdkVersion String sdk版本
sn String 设备sn
thingType String 设备类型
region String 区域
firmwareVersion String 固件版本号
rbacTenantId String 租户id
status Integer 设备状态

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697"
    }
}

正常返回示例

{
    "code": 200,
    "data": {
        "gmtModified": 1517918765000,
        "activeTime": null,
        "deviceKey": "Kq7rgvE2cNGcwtDexwJh",
        "gmtCreate": 1500017648000,
        "productKey": "kQGJJuTl0qA",
        "statusLast": null,
        "mac": null,
        "netAddress": null,
        "deviceSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "iotId": "03iGXYVl03e23f667d90269c2ccwgzHG",
        "name": "Kq7rgvE2cNGcwtDexwJh",
        "tenantId": 7,
        "nickname": null,
        "sdkVersion": null,
        "sn": null,
        "thingType": "DEVICE",
        "region": "daily",
        "firmwareVersion": "1.0.0",
        "rbacTenantId": "ADSBCUYAGDCUDD827918327917",
        "ownerDomain": "kQGJJuTl0qA",
        "status": 1
    },
    "message": "success",
    "localizedMsg": null
}

错误码

错误码 错误信息 详细描述

批量获取物

定义描述

path
版本
描述
是否需要cloudToken
/cloud/things/get
1.0.1
批量获取物

请求参数

参数 类型 必填 描述
productKey String 物的产品key
status Int 设备状态 0 - 未激活, 1 - 在线, 3 - 离线, 8 - 禁用
currentPage Int 分页查询
pageSize Int 分页大小

返回参数

参数 类型 必有 描述
totalNum Long 总记录数
items List 设备列表

items列表结构

参数 类型 描述
gmtModified Long 数据修改时间
activeTime Long 设备激活时间
gmtCreate Long 设备创建时间
productKey String 产品key
statusLast Integer 上一次设备状态
mac String mac地址
deviceSecret String 设备secret
iotId String 设备唯一标识符
name String 设备名称
nickname String 设备昵称
sdkVersion String sdk版本
sn String 设备sn
thingType String 设备类型
region String 区域
firmwareVersion String 固件版本号
rbacTenantId String 租户id
status Integer 设备状态

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "productKey": "xxxxxxxxxxxxx",
        "status": 3
    }
}

正常返回示例

{
    "code": 200,
    "data": [
        {
            "gmtModified": 1517922329000,
            "offset": null,
            "activeTime": null,
            "deviceKey": "d7CllT0DOCdZj7SIu1Lp",
            "gmtCreate": 1501118101000,
            "productKey": "wLpXolYeCtR",
            "statusLast": null,
            "mac": null,
            "netAddress": null,
            "iotId": "d7CllT0DOCdZj7SIu1Lp0010990700",
            "deviceSecret": "u98PDRJsrwzhy/4cV1ThAEGNclSH0UQs7lksQaRPbTpMTjef48Cf6YX+sqcP1Ky7",
            "name": "\r\n",
            "tenantId": 7,
            "nickname": null,
            "limit": null,
            "sdkVersion": null,
            "sn": null,
            "thingType": "DEVICE",
            "region": "daily",
            "firmwareVersion": null,
            "rbacTenantId": "ADSBCUYAGDCUDD827918327917",
            "ownerDomain": "wLpXolYeCtR",
            "status": 1
        },
        {
            "gmtModified": 1517922329000,
            "offset": null,
            "activeTime": null,
            "deviceKey": "K1XuEDskFI47NvWgiQaq",
            "gmtCreate": 1501123511000,
            "productKey": "wLpXolYeCtR",
            "statusLast": null,
            "mac": null,
            "netAddress": null,
            "iotId": "K1XuEDskFI47NvWgiQaq0010d93300",
            "deviceSecret": "bZx3d91jj/hZs27AJsNKg3830aUd6ne37NRTMO5Rdc5MTjef48Cf6YX+sqcP1Ky7",
            "name": "K1XuEDskFI47NvWgiQaq",
            "tenantId": 7,
            "nickname": null,
            "limit": null,
            "sdkVersion": null,
            "sn": null,
            "thingType": "DEVICE",
            "region": "daily",
            "firmwareVersion": null,
            "rbacTenantId": "ADSBCUYAGDCUDD827918327917",
            "ownerDomain": "wLpXolYeCtR",
            "status": 1
        }
    ],
    "message": "success",
    "localizedMsg": null
}

错误码:

错误码 错误信息 详细描述

获取物的事件timeline数据

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/event/timeline/get 1.0.1 获取物的事件timeline数据

请求参数

参数 类型 必填 描述
iotId String 物的唯一标识符
identifier String 属性标识符
eventType String 事件类型
start Long timeline起始时间
end Long timeline终止时间
pageSize Int 分页查询条数
ordered Boolean 顺序(true)、逆序(false)查询

返回参数

参数 类型 描述
eventCode String 事件标识符
iotId String 物的唯一标识符
eventName String 事件名称
eventType String 事件类型
eventBody Object 事件参数
batchId String 批次id
timestamp Long 时间采集时间

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697",
        "identifier": "xxxx",
        "eventType": "xxxx",
        "start": 1517217645000,
        "end": 1517217645000,
        "pageSize": 10,
        "ordered": true
    }
}

正常返回示例

{
    "code": 200,
    "message": "success",
    "localizedMsg": "",
    "data": {
        "items": [
            {
                "eventCode": "Error",
                "iotId": "YzqEnI5DY03rxLS2pjjo0010840500",
                "eventName": "故障上报",
                "eventType": "info",
                "eventBody": {
                    "ErrorCode": 0
                },
                "batchId": "5ebc6a9c7d15459f823edde6d28c8fb3",
                "timestamp": 1516342985261
            },
            {
                "eventCode": "Error",
                "iotId": "YzqEnI5DY03rxLS2pjjo0010840500",
                "eventName": "故障上报",
                "eventType": "info",
                "eventBody": {
                    "ErrorCode": 0
                },
                "batchId": "4a0b5a7ac85e470684438d5ff77456f1",
                "timestamp": 1516342995305
            }
        ],
        "timestamp": 1516343075699
    }
}

错误码

错误码 错误信息 详细描述

获取物的属性timeline数据

定义描述

path 版本 描述 是否需要cloudToken
/cloud/thing/property/timeline/get 1.0.1 获取物的属性timeline数据

请求参数

参数 类型 必填 描述
iotId String 物的唯一标识符
identifier String 属性标识符
start Long timeline起始时间
end Long timeline终止时间
pageSize Int 分页查询条数(最大200)
ordered Boolean 顺序(true)、逆序(false)查询

返回参数

参数 类型 描述
iotid String 设备标识符
data Object 设备timeline数据
modifytime Long 属性更新时间
property String 属性标识符
batchId String 批次id
timestamp Long 属性采集时间戳

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.1",
        "cloudToken": "token"
    },
    "params": {
        "iotId": "D95D242941CE821ECCE4F31A2697",
        "identifier": "xxxx",
        "start": 1517217645000,
        "end": 1517217645000,
        "pageSize": 10,
        "ordered": true
    }
}

正常返回

{
  "code": 200,
  "message": "success",
  "localizedMsg": null,
  "data": {
    "items": [
      {
        "iotid": "xqxyZjSKzCwaGdlvbv0O0010851c00",
        "data": 1.23,
        "modifytime": 1511812747287,
        "property": "LightVolt",
        "batchId": "2fc766c5e7064554933ed1f3e4b61803",
        "group": null,
        "timestamp": 1511812747245
      },
      {
        "iotid": "xqxyZjSKzCwaGdlvbv0O0010851c00",
        "data": 1.24,
        "modifytime": 1511812747288,
        "property": "LightVolt",
        "batchId": "2fc766c5e7064554933ed1f3e4b61803",
        "group": null,
        "timestamp": 1511812747245
      }
    ],
    "timestamp": 1511812747245
  }
}

错误码

错误码 错误信息 详细描述

results matching ""

    No results matching ""