简要描述:

  • 通过该接口查询设备上报的事件记录

接口版本:

版本号 制定人 制定日期 修订日期
1.0.0 张浩 2023-06-29

请求URL:

iot-platform/device-thing-model-server/v1/event/history/getPage

请求方式:

  • GET

请求头:

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

请求参数:

参数名 是否必须 类型 说明
page Int 当前页数,默认值是1
limit Int 一页条数 数量限制:每页最多可显示50条。默认值是10
productId String 产品ID
deviceId String 设备ID
identifier String 事件标识符
module String 所属模块,默认为default模块
startTime Long 要查询的事件记录的开始时间。格式为毫秒级的13位时间戳,
endTime Long 要查询的事件记录的开始时间。格式为毫秒级的13位时间戳,

返回示例:

正确时返回:

{
  "code": 0,
  "msg": "ok",
  "err_code": 10000,
  "result":  {
     "list": [
      {
        "eventType":"info",
        "identifier":"switch",
        "name":"开关",
        "time":1686298959673,
        "output":{
          "type":"fingerprint"
        }
      }
    ]
  }
}

错误时返回:

{
  "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 list Array 查询的事件记录列表

list返回值描述:

字段名称 字段类型 是否必须 描述
1 eventType String 事件的类型,枚举值:【info,fault,warning】
2 identifier String 事件的标识符
3 name String 事件的名称
4 time Long 事件的上报时间,毫秒值
5 output Object 事件的输出
6 output.${key} String 事件输出字段名称
7 output.${value} Object 事件输出字段值

备注:

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