10-16-2020 06:32
10-16-2020 06:32
Hi,
I'm trying to get data user data. After executing the below code the callback URL results in -
http://localhost:8080/?code=f2c2b46a44d8981f9c0d5e0ededa3af6e973ee9c#_=_
I'm not getting the access token and the user_id in the callback URL rather I'm getting code.
Where am I going wrong???
index.html
10-19-2020 12:37
10-19-2020 12:37
The value "f2c2b46a44d8981f9c0d5e0ededa3af6e973ee9c" is the authorization code. You need to send Fitbit the authorization code to receive the access token and refresh token. Here's an example
POST https://api.fitbit.com/oauth2/token
Authorization: Basic Y2xpZW50X2lkOmNsaWVudCBzZWNyZXQ=
Content-Type: application/x-www-form-urlencoded
client_id=22942C&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fexample.com%2Ffitbit_auth&code=1234567890