Reputation: 2058
Brand new to the Fitbit API but this is what I've got so far.
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:
Upvotes: 0
Views: 1889
Reputation: 1
Try this code - it's working fine for me.
require 'fitbitphp.php';
$consumer_key ='fe31e0c7da0340a1b407dc8013adaf161223343';
$consumer_secret='4dcd125021094d45bc405ab0343q2231984f432';
$fitbit = new FitBitPHP($consumer_key, $consumer_secret);
$fitbit->setUser('XXXXXX');
$xml = $fitbit->getProfile();
print_r($xml);
Upvotes: 0
Reputation: 2058
FITBIT_KEY & FITBIT_SECRET were not previously defined in the GitHub provided wrapper. This has to be defined in order to pull data.
Upvotes: 1