poolfork
poolfork

Reputation: 40

issues trying to refresh OAuth token

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

Answers (1)

cli-ish
cli-ish

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

Related Questions