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

Server side fetching of data

Hi.
I am new to web development and will use Fitbit API for a small project for personal use using Node js and we're trying to build a server side API where it is ran by a CRON job daily and the fetched data from the Fitbit APIs will be saved to the database. My question is, would this be possible? because the authorization page will show after running it using CRON. But local development will only ask me once to permit the authorization page.

 

Thank you.

Best Answer
0 Votes
3 REPLIES 3

Hi @rdaltonjay 

 

Welcome to the forums!

 

Yes this is possible, as many of our developers already implement cron jobs in their integrations to pull data. Could you tell me which authorization flow (implicit or auth code) you're using for your application?

 

 

Best Answer
0 Votes

Hello @JohnFitbit 

 

Thank you for replying. We were able to get it to work now. We just had to implement the refresh token to fetch new access token and to have it perpetually running. We are using implicit for authorization flow.

Best Answer
0 Votes

Hi @rdaltonjay 

 

Happy to hear your implementation is up and running. However, I think there is confusion regarding your authorization flow statement. The Implicit Grant Flow does not use refresh tokens. When an access token obtained through the Implicit Grant Flow expires, the user will need to go through the authorization process again to provide consent. The Authorization Code Grant flow on the other hand, uses refresh tokens to refresh an expired access token. Did you mean to say that you were using the Authorization Code Grant Flow. not Implicit?

 

Documentation:

Let me know if you have additional questions.

 

 

Best Answer
0 Votes