---
title: "弃用"
method: POST
path: "/api/v1/things/device/msg/property-agg/by-device/index"
tags: ["things/device/msg", "thingsDeviceMsg"]
---

# 弃用

`POST /api/v1/things/device/msg/property-agg/by-device/index`

## Request body

- DeviceMsgPropertyAggByDeviceIndexReq
  - `aggs` DeviceMsgPropertyAggByDevice[], required — 聚合对象
    - `argFuncs` string[], required — 聚合函数 avg:平均值 first:第一个参数 last:最后一个参数 count:总数 twa: 时间加权平均函数 参考: https:docs.taosdata.com/reference/taos-sql/function/#apercentile
    - `dataID` string — 获取的具体标识符的数据
    - `device` DeviceCore, required
      - `deviceName` string, required — 设备名称
      - `productID` string, required — 产品ID
      - `productName` string
    - `fill` string — 指定窗口区间数据缺失的情况下的填充模式 参考: https:docs.taosdata.com/reference/taos-sql/distinguished/#fill-%E5%AD%90%E5%8F%A5
    - `noFirstTs` boolean — 时间戳填充不填充最早的值,聚合模式使用
  - `interval` integer — 间隔 如果这个值不为零值 则时间的开始和结束必须有效及聚合函数不应该为空
  - `intervalUnit` string — 间隔单位 a (毫秒,默认), d (天), h (小时), m (分钟), n (月), s (秒), u (微秒), w (周), y (年) 则时间的开始和结束必须有效及聚合函数不应该为空
  - `partitionBy` string — 切分数据,可以填写deviceName
  - `timeEnd` string — 时间的结束(毫秒时间戳)
  - `timeStart` string — 获取时间的开始(毫秒时间戳)

## Response `200`

A successful response.

- object
  - `code` integer
  - `data` DeviceMsgPropertyLogAggIndexResp
    - `list` DeviceMsgPropertyLogAggResp[], required
      - `areaID` string — 只有partitionBy 传该参数的时候才会返回
      - `areaIDPath` string — 只有partitionBy 传该参数的时候才会返回
      - `areaIDs` string[] — 只有partitionBy 传该参数的时候才会返回
      - `belongGroup` object — key是group的purpose, value是里面包含的分组id 只有partitionBy 传该参数的时候才会返回
      - `deviceName` string — 设备名称
      - `productID` string
      - `projectID` string — 只有partitionBy 传该参数的时候才会返回
      - `tenantCode` string — 只有partitionBy 传该参数的时候才会返回
      - `values` DeviceMsgPropertyLogAggRespDetail[], required
        - `dataID` string, required — 属性ID
        - `dataName` string, required — 属性名称
        - `timeWindow` string, required — 发生时间窗口
        - `values` object, required — key是聚合函数
  - `msg` string

## Changes

- **2026-03-27** `b9582d0ab6af` — 1 breaking, 1 info
  - added required request body
  - added the media type `application/json` for the response with the status `200`
- **2025-10-16** `280ff9b621cf` — 1 info
  - endpoint added
- **2025-03-14** `e87dbcac5d9e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/unitedrhino/apis/things-api/changes/api/v1/things/device/msg/property-agg/by-device/index/post.md)

---

[API](https://skmtc.dev/unitedrhino/apis/things-api.md) · [All operations](https://skmtc.dev/unitedrhino/apis/things-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/unitedrhino/things-api/revisions/f3bdeb916389/schema)
