Reputation: 40
I'm trying to refresh my infusionsoft token, using this guide from their documentation: https://developer.infusionsoft.com/authentication/#refresh-access-token
$url = "https://api.infusionsoft.com/token";
$client_id = '';
$client_secret = '';
$refresh_token = '';
$options = array(
'http' => array(
'header' => "Content-type: application/json\r\n".
"Authorization: Basic ". base64_encode($client_id. ":". $client_secret),
'grant_type' => 'refresh_token',
'refresh_token' => $refresh_token,
'method' => 'POST',
)
);
Does anything jump out at you? I am also reaching out for help on Infusionsoft forums as well, but I was wondering if any of you have done this before.
Upvotes: 0
Views: 95
Reputation: 776
grant_type and other variables need to be send as post parameter, you are currently sending them as http headers.
Also done here: How to post data in PHP using file_get_contents?
Upvotes: 1