Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How does subscription work with intraday data?

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, 

Best Answer
0 Votes
7 REPLIES 7

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.

Best Answer
0 Votes

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
            }
        ],
Best Answer
0 Votes

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.

Best Answer

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?

Best Answer
0 Votes

@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.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

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?

Best Answer
0 Votes

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.

Best Answer
0 Votes