Brand new to the Fitbit API but this is what I've got so far.
- I've successfully installed OAuth on my server and verified.
- I downloaded Fitbit's PHP example - completeAuthorization.php however after browsing to it on my server and clicking "Allow" it takes me to localexample.fitbit.com/php/completeAuthorization.php?oauth_token=...&oauth_verifier=... which is a 404. oauth_token and oauth_verifier removed to protect the innocent
I drop that idea and then try to use the GitHub project FitbitPHP and created (based on their README.md file) the following:
require 'fitbitphp.php'; $fitbit = new FitBitPHP(FITBIT_KEY, FITBIT_SECRET); $fitbit->setUser('XXXXXX'); $xml = $fitbit->getProfile(); print_r($xml);
The XXXXXX is my 6 digit user ID I pulled from my profile. The screen is rendering a blank white page and I'm not sure how to diagnose this. I used the API Explorer and seemed to have positive results. Could someone provide some much needed direction? My goal is to simply output my profile data so I can style it on a webpage. Thanks in advance.
Sources: