12-27-2015 17:16
12-27-2015 17:16
I've done the initial programmatic OAuth configuration and stored the Access Token and the Refresh Token. I'm struggling with the way to use the Access Token to request information through the API. The php library that I'm using says to set the OAuth authorization this way:
$fitbit->setOAuthDetails('token_stored_for_user', 'secret_stored_for_user');
I have the 'token_stored_for_user' stored and available, but don't know where the 'secret_stored_for_user' comes from? I only have the Access Token and the Refresh Token.
Thanks, Len
Answered! Go to the Best Answer.
12-29-2015 06:56
12-29-2015 06:56
@ljhardy: That library has not been updated to use OAuth 2.0. It won't use refresh tokens. You should find an OAuth 2.0 library for PHP and configure it to use the Fitbit Web API.
12-28-2015 16:50
12-28-2015 16:50
Without knowing which library you're using I can't help you.
But you can have a look at https://github.com/jmitchell38488/fitbit
You can install it with composer by:
composer require jmitchell38488/fitbit
This will automatically download the latest version. How to use the library is available in the README.md document.
12-28-2015 17:20
12-28-2015 17:20
Thanks, I'll give that library a try. BTW, this is the one that I was trying to use:
https://github.com/heyitspavel/fitbitphp
Unless I'm missing something your readme.md file only shows installation instructions? :
FitBit API Provider
This package makes it simple to integrate your application with FitBit.
Installation
composer require jmitchell38488/fitbit
Thanks, Len
12-29-2015 06:56
12-29-2015 06:56
@ljhardy: That library has not been updated to use OAuth 2.0. It won't use refresh tokens. You should find an OAuth 2.0 library for PHP and configure it to use the Fitbit Web API.
12-29-2015 06:59
12-29-2015 06:59
Got it. Thanks Jeremiah.
--Len