02-17-2021 10:53
02-17-2021 10:53
Hi,
I've been integrating with a few different fitness APIs recently and fitbi looks slightly different to these with regards to the 'subscriptions'. I've read the docs, but can someone please confirm this so I don't over engineer something that can be solved simply.
It looks like, when a user records an activity, it sends a request to my subscription endpoint that just tells me 'a user has updated an activity, here's their user ID'. I then have to make a request and view the daily summary for that user. For my purposes, I'd then have to loop through each of these activities, and work out which ones I've already received. This sounds fairly long winded for something that other APIs make so simple.
An alternative flow that seems to be used is 'We'll send you a request with the user ID and activity ID'. You then get the info of that activity using those IDs.
The second one seems much simpler, can someone just confirm that this isn't possibly using the fitbit API and I'll have to check each activity every time?
Thanks!
02-17-2021 15:12
02-17-2021 15:12
Hi @Tobias_C,
Welcome to the forums!
Your understanding of the Subscriptions API is correct. A notification will only let you know that there is new data for the collection you subscribed to and it will be up to your application to find out what data by executing the appropriate endpoints.
This isn't the first time this has been of concern to a developer, and in fact, we asked them to share their idea of how the Subscriptions API can be improved to better notify applications of what data was actually changed. I recommend adding your suggestion to this feature suggestion post created by another developer so that we can continue tracking interest for this functionality. When it collects enough interest, our product teams may consider improving the API based on this request.
Let me know if you have any additional questions.