10-05-2021 08:59
10-05-2021 08:59
Hi, I'm working on creating a dashboard for myself and some of my fitness data over time. My plan was to download some of my stats daily to so I can track and create my own views, etc. However, as the data download would happen in the background, I don't want to have to have any user interaction in order to make the API calls. Is there a way around this?
10-05-2021 12:02
10-05-2021 12:02
Hi @Ramshackle
It's possible to code an application, script or dashboard [e.g. "application"] to pull the data daily using the Web APIs. You'll need to register your application at dev.fitbit.com/apps. You'll authorize your Fitbit user id to share data with your application. There are 2 ways to scheduling pulling of the data
We have a Developer Guide available to help you get started using the Web APIs
10-05-2021 13:06
10-05-2021 13:06
Thank you!
I'm well along path #1 right now, but as I said, I'm stuck on the part about authentication for this mechanism requiring a user and browser be present. Can you confirm that this is the case?
I didn't know about subscriptions, this is promising and might be a better option, but I'd still like to know if I need to use the fitbit auth page for the regular web API calls.
Thanks
10-05-2021 16:01
10-05-2021 16:01
Each user who data you want to retrieve through the Web APIs will need to go through the consent process / Fitbit auth page. They only need to do it once as long as your application maintains the access token and refresh tokens correctly. When your application detects the access token has expired by receiving the "401 Unauthorized" expired token error, your application will need to use the refresh token to obtain a new access token and refresh token.