APIs & Integrations

arminsolo
Member

Installation Code Expiry Date

Hi,
What is the authorization code expiry date during installation the app in client instance?

0 Upvotes
4 Replies 4
worldcup123
Member

Installation Code Expiry Date

Hi, this is a different problem .

Hi, I wrote the code and received this json response:

{“refresh_token”:“xxx-xx-xx-xx-xx”,“access_token”:“xxxx”,“expires_in”:21600}

but access token is not getting stored on $myrs variable.

Here is the full code :

$cod=$_GET[“code”];

$url=“https://api.hubapi.com/oauth/v1/token?grant_type=authorization_code&client_id=x-x-x-x-x&client_secre...”.$cod;

$agent= ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)’;

$ch = curl_init();
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_HTTPHEADER, [‘Content-Type: application/x-www-form-urlencoded’]);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL,$url);

$result=curl_exec($ch);

$rest= (json_decode($result, true));
$myrs=$rest[“access_token”];

How can i store the access token in a variable ?

Thank you!

0 Upvotes
arminsolo
Member

Installation Code Expiry Date

Anyone can help me here?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Installation Code Expiry Date

Hi @arminsolo

The auth code will expire 10 minutes after it’s generated, so you’ll want to make sure that you’re generating the refresh token and initial access token before that (though generally you should be doing that as soon as your app gets that code).

0 Upvotes
arminsolo
Member

Installation Code Expiry Date

@dadams
Thank you for your reply!!
Can we increase the expiry time frame from our end or it is standard timing from your end and it is not changeable. The reason is we would like to give authorization URL to our customers to install the app however due to timing zone difference, the code will be expired when customer come back to us.

0 Upvotes