简要描述:
- 通过该接口查询设备行为的调用记录
接口版本:
| 版本号 | 制定人 | 制定日期 | 修订日期 | 
|---|---|---|---|
| 1.0.0 | 张浩 | 2023-06-29 | 
请求URL:
iot-platform/device-thing-model-server/v1/action/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 | 所属模块 | 
| messageId | 否 | String | 消息ID | 
| startTime | 是 | Long | 要查询的事件记录的开始时间。格式为毫秒级的13位时间戳, | 
| endTime | 是 | Long | 要查询的事件记录的开始时间。格式为毫秒级的13位时间戳, | 
| proposerType | 否 | String | |
| proposer | 否 | String | 
返回示例:
正确时返回:
{
  "code": 0,
  "msg": "ok",
  "err_code": 10000,
  "result":  {
     "list": [
      {
        "eventType":"info",
        "identifier":"switch",
        "name":"开关",
        "time":1686298959673,
        "outputTime":1686298959674,
        "input":{
          "type":"fingerprint"
        }
        "output":{
          "type":"fingerprint"
        },
        "proposer":{}
      }
    ]
  }
}错误时返回:
{
  "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 | 否 | 行为输出字段值 | 
| 8 | input | Object | 是 | 行为输入 | 
| 9 | input. ${key} | String | 是 | 行为输入 字段名称 | 
| 10 | input. ${value} | Object | 是 | 行为输入 字段值 | 
| 11 | outputTime | Long | 否 | 输出时间,毫秒值 | 
| 12 | messageId | String | 否 | 消息I | 
备注:
- 更多返回错误代码请看首页的错误代码描述
  创建时间:2024-12-16 18:25
最后编辑:admin 更新时间:2025-04-29 15:30
最后编辑:admin 更新时间:2025-04-29 15:30
