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

Update Webhook Notification to indicate activity log list or daily activity summary has updated data

Currently, the webhook notification can contain a collectionType of "activities", which indicates that either the activity log list or the daily activity summary has updated data. As it does not make a distinction between the two, I have to make two Fitbit API calls for every notification; one for the log list and the other for the summary, as I don't know which one has changed. This doubles the number of API calls for every user, and for a highly active user will bring us closer to the API call-limit every hour.

If you could update the Notification to use distinct collectionTypes for activity log list vs. daily summary, or add a new property that indicates same, this will enable me to make our code more efficient and make less Fitbit API calls (thus reducing the load on your servers).

Best Answer
2 REPLIES 2

Hi @GrahamYF 

 

You are correct the notifications will tell you the collection of data that has changed for the user.  After receiving the notification, you should call the necessary endpoints containing the information important to you.  For most of our users, the Get Daily Activity Summary endpoint provides the information that they need.   The Get Activity Log List will provide more detail about the recorded activity.   We have an enhancement request already to provide more data in the notification.   I will add your name to the list requesting this enhancement.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

If this feature is chosen to be developed, could you add some way for us to know when 'orphaned' steps occurred in the daily summary endpoint? When a user generates steps but did not create an activity, these steps are not captured in the log list and we are not certain when they happened. The method in this answer: https://community.fitbit.com/t5/Web-API-Development/Capture-Steps-Without-An-Activity/m-p/5349859#M1... can be used to get the steps but not when they occurred during that day. An array of orphan-only steps grouped by hour even would not be bad. As things are now when we get the webhook, and even if we could know it was an update to the daily summary, we wouldn't know which of the total steps happened since the last update, or when they happened within the day. We could calculate the former but not the latter. Ultimately it would be useful to know what exactly changed since the last update. Please let me know if I explained this poorly, or if there are any questions, or if I should make a separate issue, though I think it is related to the above. I hit the +affects me too button because even without what I am requesting here I'd love to be able to reduce the api calls.

 

Best Answer
0 Votes