Get Rollup Data for a Stream
Use the following API request to get rollups of stream history. Rollups are defined by a method (average, min, max, and so on) and an interval (hourly, daily, and so on).
This request returns the average for each hour during the last day.
Request
GET /ws/v1/streams/rollups/F9F967B4-33804DCE-2BDC4702-45053B1C/temperature?method=average&interval=hour&start_time=-1d
Alternatively use a timestamp for start_time:
GET /ws/v1/streams/rollups/F9F967B4-33804DCE-2BDC4702-45053B1C/temperature?method=average&interval=hour&start_time=2014-02-23T00:00:00.000Z
Response
{
"count": 2,
"size": 1000,
"start_time": "2014-02-23T00:00:00.000Z"
"list": [
{
"stream_id": "F9F967B4-33804DCE-2BDC4702-45053B1C/temperature",
"timestamp": "2014-02-23T18:00:00.000Z",
"value": 69.0
},
{
"stream_id": "F9F967B4-33804DCE-2BDC4702-45053B1C/temperature",
"timestamp": "2014-02-23T19:00:00.000Z",
"value": 71.0
}
],
}