Get Access Token

echo "<br>Here is your code: " . $code.'<br>'; 

$ch = curl_init($base_url . "oauth2/token");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$fields = array(
     'client_id' => $client_id,
     'client_secret' => $client_secret,
     'grant_type' => 'authorization_code',
     'redirect_uri' => $redirect_uri,
     'code' => $code
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$data = curl_exec($ch);
$response = json_decode($data, true);

echo "<pre>".print_r($response,true)."</pre>";

echo 'Here is your token: '.$response["access_token"];


ok so im getting the CODE from but i cant get the acces token and im running this from a local machine. Some items i get NULL on the token

Ok so i found out that this dosent work on a LOCAL Machineā€¦

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.