We've experienced a high number of repeat requests for a single user today that's causing us to hit the rate limit for that user. Our logs are showing posts from Fitbit to our subscription endpoint 1 - 2 times per minute every minute for the last ~4 hours with update notifications for the same user. Each request contains the same 4 dates to update in the range of 2016-01-13 to 2016-01-17.
When we GET the activity endpoint for the user there doesn't appear to be any updated data there.
GET: https://api.fitbit.com/1/user/-/activities/date/2016-01-14.json
Can you provide any insight into what might be going on here?
The request body looks like this:
[ { collectionType: 'activities',
date: '2016-01-14',
ownerId: '<owner-id>',
ownerType: 'user',
subscriptionId: '<subscription-id>' },
{ collectionType: 'activities',
date: '2016-01-17',
ownerId: '<owner-id>',
ownerType: 'user',
subscriptionId: '<subscription-id>' },
{ collectionType: 'activities',
date: '2016-01-13',
ownerId: '<owner-id>',
ownerType: 'user',
subscriptionId: '<subscription-id>' },
{ collectionType: 'activities',
date: '2016-01-15',
ownerId: '<owner-id>',
ownerType: 'user',
subscriptionId: '<subscription-id>' } ]
Answered! Go to the Best Answer.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
I responded to your private support ticket.
For anyone else interested, this was caused by a device not properly syncing.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
No manual entry activities were ever returned as part of the user's summary data. The subscription updates (now finally stopped) were sent every minute or more (until the rate limit was hit) for ~7 hours in total which doesn't seem like normal update behavior. The updates were always for the same 4 dates as well.
The only data I can see changing are the tracker distances data. For example, here are 3 responses from the /user/-/activities/date/2016-01-14.json endpoint a few hours apart. Notice how tracker distance goes from 4.64 to 10.29 and then back to 4.64.
4 May 2016 10:21:16
{"activities":[],"goals":{"activeMinutes":30,"caloriesOut":2855,"distance":8.05,"floors":10,"steps":10000},"summary":{"activeScore":-1,"activityCalories":1134,"caloriesBMR":1927,"caloriesOut":2798,"distances":[{"activity":"total","distance":4.64},{"activity":"tracker","distance":4.64},{"activity":"loggedActivities","distance":0},{"activity":"veryActive","distance":0},{"activity":"moderatelyActive","distance":0},{"activity":"lightlyActive","distance":4.64},{"activity":"sedentaryActive","distance":0}],"elevation":42.67,"fairlyActiveMinutes":0,"floors":14,"lightlyActiveMinutes":255,"marginalCalories":578,"sedentaryMinutes":1185,"steps":6700,"veryActiveMinutes":0}}
4 May 2016 12:20:07
{"activities":[],"goals":{"activeMinutes":30,"caloriesOut":2673,"distance":8.05,"floors":10,"steps":10000},"summary":{"activeScore":-1,"activityCalories":1030,"caloriesBMR":879,"caloriesOut":1745,"distances":[{"activity":"total","distance":10.29},{"activity":"tracker","distance":10.29},{"activity":"loggedActivities","distance":0},{"activity":"veryActive","distance":7.05},{"activity":"moderatelyActive","distance":0.24},{"activity":"lightlyActive","distance":2.99},{"activity":"sedentaryActive","distance":0}],"elevation":118.87,"fairlyActiveMinutes":3,"floors":39,"lightlyActiveMinutes":123,"marginalCalories":692,"sedentaryMinutes":140,"steps":11922,"veryActiveMinutes":55}}
4 May 2016 13:16:45
{"activities":[],"goals":{"activeMinutes":30,"caloriesOut":2855,"distance":8.05,"floors":10,"steps":10000},"summary":{"activeScore":-1,"activityCalories":1134,"caloriesBMR":1927,"caloriesOut":2798,"distances":[{"activity":"total","distance":4.64},{"activity":"tracker","distance":4.64},{"activity":"loggedActivities","distance":0},{"activity":"veryActive","distance":0},{"activity":"moderatelyActive","distance":0},{"activity":"lightlyActive","distance":4.64},{"activity":"sedentaryActive","distance":0}],"elevation":42.67,"fairlyActiveMinutes":0,"floors":14,"lightlyActiveMinutes":255,"marginalCalories":578,"sedentaryMinutes":1185,"steps":6700,"veryActiveMinutes":0}}
Some sort of sync loop maybe?
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
I responded to your private support ticket.
For anyone else interested, this was caused by a device not properly syncing.
Thanks Jeremiah. We'll add some additional logic on our end to deal with the situation.
For anyone else that finds this thread, a few takeaways: