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

Possible to authenticate without authorization page?

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?

Best Answer
3 REPLIES 3

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

  1. If you just plan to pull the data once per day, your application can just pull the data at a specific time (i.e. midnight).
  2. If you want to see updates to your data throughout the day, then I recommend the subscription APIs to notify your application when new data is available.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/using-subscriptions/.

We have a Developer Guide available to help you get started using the Web APIs

 

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

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

Best Answer
0 Votes

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.

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