简要描述:

  • 查询设备物模型属性上报值

接口版本:

版本号 制定人 制定日期 修订日期
1.0 张浩 2023-08-16

请求URL:

iot-platform/device-thing-model-server/v1/property/get

请求方式:

  • POST

请求头:

参数名 是否必须 类型 说明
Content-Type string 请求类型: application/json
Authorization string 请求鉴权

请求示例:

{
    "productId":"AAcmXyLkS1",
    "deviceId":"339a0519f96b432092d6c3451b2dd53e",
    "properties": {
        "default":[
              "power",
               "color"
         ]
    }
}

请求参数:

参数名 是否必须 类型 说明
productId string 产品ID
deviceId string 设备ID
properties Object 属性对象
properties.{module} List(string) 属性标识符列表,如果列表为空,则返回全部属性

返回示例:

正确时返回:

{
  "code": 0,
  "msg": "ok",
  "err_code": 10000,
  "result":  {
      "default":{
           "color":{
              "value":"bulue",
            "time": 1686279797398
         },
         "power":{
            "value":1,
            "time": 1686279797398
         }
    }

  }
}

错误时返回:

{
  "code": -1,
  "msg": "${errorMessage}",
  "err_code": ${errorCode},
  "result": null
}

返回参数说明:

字段名称 字段类型 是否必须 描述
1 code int 状态码,为0时表示接口调用成功,不为0时表示接口调用失败
2 err_code int 错误码,当code为0时,返回10000,否则返回对应错误码
3 msg String 错误的具体消息
4 result Object 返回的结果,当调用失败时为空

result返回值描述:

字段名称 字段类型 是否必须 描述
1 {module} String 传入的模块标识符
2 {module}.{propertyIdentifier} String 传入的属性标识符,如有值,则返回
3 {module}.{propertyIdentifier}.value Object 属性的值
4 {module}.{propertyIdentifier}.time Long 属性值更新的时间,unix时间戳毫秒值

备注:

  • 更多返回错误代码请看首页的错误代码描述
 创建时间:2023-08-17 16:50
最后编辑:陈勇琦  更新时间:2024-10-18 10:58