根据属性查询设备事件

GET /api/devices/{deviceId}/attributeCode

返回的数据是创建时间升序的,如果想查询时间段内所有数据,只需要以最后一条数据的创建时间作为下一次查询的起点就可以实现

返回的条数小于limit,表示已经是最后一页了,不需要继续查询

URL参数

参数名 类型 必填 描述 限制
deviceId string 设备唯一标识符
attributeCode string 属性编码
limitNum int 最多返回多少条记录,不能超过1000
startDate Date 事件日期起,格式为:2019-11-14T16%3A25%3A00.000%2B0800,默认一天前
endDate Date 事件日期止,格式为:2019-11-14T16%3A25%3A00.000%2B0800,默认当前时刻
start Long 事件日期起,如果不传startDate就以start为准,start是精确到毫秒的时间戳
end Long 事件日期止,如果不传endDate就以end为准,end是精确到毫秒的时间戳

请求样例

GET /api/devices/146b3c23-55c7-4f24-bcb1-2c46cbae8370/attributeCode?attributeCode=atmosphere&pageSize=2&pageNo=1 HTTP/1.1
Host: zl.glodon.com
Authorization: Bearer xxx.xxxx.xxx
Cache-Control: no-cache

响应样例

{
  "returnCode": 0,
  "result": [
      {
        "createdTime": 1573800684000,
        "id": "146b3c23-55c7-4f24-bcb1-2c46cbae8370@#atmosphere@#1573800684000",
        "tenantId": "b0d9addd-4221-4a7e-a49f-4615891d533f",
        "projectId": "e97e3c0e-1e17-4c61-9ef0-359eaea97de9",
        "modelId": "606840d4-a625-42ce-9885-3b43402aeb16",
        "deviceId": "146b3c23-55c7-4f24-bcb1-2c46cbae8370",
        "attributeCode": "atmosphere",
        "attributeType": "Float",
        "attributeData": 1,
        "channel": "m",
        "ingressTimeStamp": 1573800684000,
        "deviceTimestamp": 1573800684000,
        "correlationId": "",
        "deleted": false
      },
      {
        "createdTime": 1573800689000,
        "id": "146b3c23-55c7-4f24-bcb1-2c46cbae8370@#atmosphere@#1573800689000",
        "tenantId": "b0d9addd-4221-4a7e-a49f-4615891d533f",
        "projectId": "e97e3c0e-1e17-4c61-9ef0-359eaea97de9",
        "modelId": "606840d4-a625-42ce-9885-3b43402aeb16",
        "deviceId": "146b3c23-55c7-4f24-bcb1-2c46cbae8370",
        "attributeCode": "atmosphere",
        "attributeType": "Float",
        "attributeData": 1,
        "channel": "m",
        "ingressTimeStamp": 1573800689000,
        "deviceTimestamp": 1573800689000,
        "correlationId": "",
        "deleted": false
      }
    ]

}