i have issue hunspot with redirection return 301 code
$ApiDataSet = array(
‘client_id’ => ‘XXXXXX’,
‘scope’ => ‘contacts’,
‘redirect_uri’ => ‘http://localhost/mytask/account.php’
);
$header = array(
‘Accept: application/json’,
‘Content-Type: application/x-www-form-urlencoded;charset=utf-8’,
);
$endpoint = ‘http://app.hubspot.com/oauth/authorize’;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $ApiDataSet);
@curl_setopt($ch, CURLOPT_URL, $endpoint);
@curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, true);
$response = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
print_r($info);