10-16-2015 11:59
10-16-2015 11:59
Hi,
I am working on my master's project where I am thinking to create a single platform for multiple devices like jawbone and fitbit. I need to fetch fitbit data of various user's. I am not aware of how can I fetch data of different users provided I have their username and password using fitbit api ?
Answered! Go to the Best Answer.
10-16-2015 14:24
10-16-2015 14:24
Correct: the access token provided by the Authorization Code Grant flow will no longer work after an hour. However, it can be replaced without user intervention. Follow the Refresh Token flow.
10-16-2015 12:09
10-16-2015 12:09
You will need to create an application that requests users' permission to access their data, then retrieve their data individually.
To get started, register your application at https://dev.fitbit.com/apps and create an OAuth 2 authorization flow to obtain consent from each user. Then use each user's access token to make data requests to the Fitbit Web API.
10-16-2015 12:12
10-16-2015 12:12
Thank you Jerem for the quick respone. I will try following the steps you provided. 🙂
10-16-2015 13:08
10-16-2015 13:08
Hey Jerem,
I registerd my application and hit the authorization api to authorize my app to fetch the user's data, but when i hit the api it does not respond me with an access token. It shows me a success message but there is no access token. Here is the response i received when i tried hitting through the browser:
"https://fhbjgbiflinjbdggehcddcbncdddomop.chromiumapp.org/oauth2-request?result=success&success="
I am also using POSTMAN as REST client but i am unable to receive the access token.
Could you tell me where I am going wrong ?
10-16-2015 13:20
10-16-2015 13:20
This is operating correctly at the Fitbit Web API, so the issue must be in your app.
Are you using the Authorization Code Grant flow or Implicit Grant flow?
The user should be redirected to your app's redirect_uri with a `state` and `code` URL parameter for the Authorization Code Grant flow. The Implicit Grant flow uses a URL fragment (data after the `#` symbol).
10-16-2015 13:55
10-16-2015 13:55
Hey Jerem,
I am using application grant flow and I think i made it through. I could successfully generate access token and fetch data. I have 1 question here:
It says the access token is for short time i.e 1 hr. So does it mean, i have to refresh the token every 1 hr to keep fetching the data ?
10-16-2015 14:24
10-16-2015 14:24
Correct: the access token provided by the Authorization Code Grant flow will no longer work after an hour. However, it can be replaced without user intervention. Follow the Refresh Token flow.
10-08-2016 15:50
10-08-2016 15:50
Hey Vrushankd,
Can you share the app you build to access fitbit user data with us ?
harsh