08-11-2016 09:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2016 09:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
May I ask how the subscription work with the intraday data? What will be the frequency of notifications? Will intraday data notification be grouped with other data types?
The data type that we are particular interested in is Heart Rate.
Thanks,

- Labels:
-
OAuth 2.0
-
Subscriptions API
08-11-2016 10:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-11-2016 10:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
These are two different concepts.
An intraday time series is one form data for a person can be expressed.
Subscriptions API sends notifications when there is new data for a person.

08-11-2016 13:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2016 13:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
For the heart rate example, an intraday time series may contain data per every minute. Does that mean if I subscribe for such an end point, I will get notification on every minute (since subscriptions API sends notifications when there is new data for a person)?
"activities-heart-intraday": { "dataset": [ { "time": "00:00:00", "value": 64 }, { "time": "00:00:10", "value": 63 }, { "time": "00:00:20", "value": 64 }, { "time": "00:00:30", "value": 65 }, { "time": "00:00:45", "value": 65 } ],

08-11-2016 14:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-11-2016 14:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
No, your app will only receive a notification when data is changed (new/updated/deleted). Because there might be 15 minutes worth of second-level heart rate data in a single device sync, your app will only get one notification for that device sync.
08-11-2016 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2016 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
OK, I see. Allow me to repeat your word with my understanding to make sure that my understanding is correct. You are saying that one notification will be generated when a device is synced and there is data changed during that syncing. Am I correct?
Then my followup will be how often a device is synced during a day? Is the device synced automatically in a peroid (every 15mins?) or manually initiated by users?

08-11-2016 14:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-11-2016 14:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@jlin Correct.
jlin wrote:Then my followup will be how often a device is synced during a day? Is the device synced automatically in a peroid (every 15mins?) or manually initiated by users?
A sync usually occurs every 15 minutes if the user is near a device they can sync to, but a sync can also be manually initiated by the user.

08-11-2016 14:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-11-2016 14:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thank you for your reply! you are so quick. I wonder if I want to implement the subscription for intraday heart rate data. Then I need to potentially handle 24*60/15=96 notification per day per users, and for each notification I need to pull the heart rate data for the day and do a deduplication. Is sounds like a performance problem. Is this recommended?

08-11-2016 15:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-11-2016 15:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Using the Subscriptions method is far better than polling Fitbit for data on a timed basis without knowing if there is new data.
The rate limit for your application is 150 requests per user per hour. You'd be well under the rate limit with your calculation. Keep in mind that some people will sync less and more frequently.

