I'm working with the Infusionsoft SDK. I've reached a roadblock in trying to make some API calls.
Any call that I make ends up with the same Call to a member function getRefreshToken() on a non-object
error (not always getRefreshToken()
though).
When I var_dump, I see that it is an object.. So, what gives?
object(Infusionsoft\Infusionsoft)#182 (13) { ["url":protected]=> string(42) "https://api.infusionsoft.com/crm/xmlrpc/v1" ["auth":protected]=> string(51) "https://signin.infusionsoft.com/app/oauth/authorize" ["tokenUri":protected]=> string(34) "https://api.infusionsoft.com/token" ["clientId":protected]=> string(24) "actual client ID" ["clientSecret":protected]=> string(10) "actual secret key" ["redirectUri":protected]=> string(65) "http://benjamin_redden.dev/wp-content/plugins/ajaxIsForm/auth.php" ["apis":protected]=> array(0) { } ["debug":protected]=> bool(false) ["httpClient":protected]=> NULL ["httpLogAdapter":protected]=> NULL ["serializer":protected]=> NULL ["needsEmptyKey"]=> bool(true) ["token":protected]=> string(24) "actual token" }
Fatal error: Call to a member function getRefreshToken() on a non-object in /Users/Krsna/Sites/benjamin_redden/wp-content/plugins/ajaxIsForm/vendor/infusionsoft/php-sdk/src/Infusionsoft/Infusionsoft.php on line 261
that is the error that I get from running a call like...
var_dump($infusionsoft);
$infusionsoft->refreshAccessToken();
or
function get_those_ids($infusionsoft){
var_dump($infusionsoft);
// get the form IDS
$formIDS = $infusionsoft->webForms()->getMap();
// make the dropdown
echo '<select name="infusionsoft_forms_which_form_would_you_like_to_use_" id="infusionsoft_forms_which_form_would_you_like_to_use_">';
foreach($formIDS as $formID => $formName){
echo '<option value="'. $formID .'">'. $formName .'</option>';
}
echo '</select>';
}