Filter results by

Aggregates by the Minute

Today we’re writing to let you know about an improvement we made in the API call that returns message aggregates. Now you can request aggregates for messages as recent as 1 minute.

The call is an HTTP GET method:

GET /messages/analytics/aggregates

You must pass as URL query parameters startDate, endDate, sdid (source device ID of the messages) and field (message field to query for analytics). The date range between the start and end dates is limited to 31 days max.

In the following example response, aggregate values are provided for a message field called stepcount. These include the total count, minimum, maximum and mean values, sum of the values, and variance.

 1 {
 2   "sdid": "deea2ca077b94d2db337722e28b41287",
 3   "startDate": "1426441570303",
 4   "endDate": "1427049970303",
 5   "field": "stepcount",
 6   "size": 1,
 7   "data": [
 8     {
 9       "count": 83,
10       "min": 23,
11       "max": 17095,
12       "mean": 5649.989,
13       "sum": 468949.06,
14       "variance": 28158896
15     }
16   ]
17 }

Previously the call gave results only on messages that were at least 1 hour old. This week we have updated the call to provide aggregates up to the previous minute. Timestamp values for startDate and endDate are now rounded to the start of the minute, so you can request aggregates for messages as they are sent to SAMI by the minute.

This should make analytics in SAMI a lot faster and more fluid for you. Let us know about other requests you might have, and we’ll keep you updated as we continue to improve SAMI.

Get the ARTIK Newsletter

You like your news fresh! Sign up now and you will be the first to know about our latest software releases, coding tips, upcoming events, blog posts, datasheet updates, and more.

* By checking either box, you may receive notifications by phone, email, text, and/or other electronic means from Samsung Semiconductor, Inc. and its affiliates. If you choose to receive partner notifications, we may forward your contact information to our partners. You may unsubscribe from these services at any time by clicking on the unsubscribe link in our communications or by submitting a request here. Please see our Privacy Policy and Terms of Use for more information about how your data is stored and used.