Keap just informed us that they will be sunsetting API keys. On August 5th, all clients who are still using Legacy API keys will experience service disruption through the actual sunset date of October 31st.
They said the way to ensure no service interruption is to move to their new
“Service Authentication Key- This will fully embrace current authentication methods and retire the existing Legacy Key, to prevent you from having to make additional updates when we revoke all Legacy Keys”
Now, my developer has created token.php script that calls the Infusionsoft API to generate a token and saves it to token.txt
<?php
$infusionsoft = new \Infusionsoft\Infusionsoft(array(
'clientId' => 'xxx',
'clientSecret' => 'xxx',
'redirectUri' => $redirect_uri
));
$message = ''; $button = '';
$file = fopen('token.txt','w+');
$token = fread($file, 99999);
if (isset($_GET['code']) and !$infusionsoft->getToken())
{
fwrite($file, serialize($infusionsoft->requestAccessToken($_GET['code'])));
$message = 'Requested access token';
}
if ($infusionsoft->getToken())
{
$token = serialize($infusionsoft->getToken());
fwrite($file, $token);
fclose($file);
$message = 'Token Saved!';
}
else
{
$button = '<br /><a href="' . $infusionsoft->getAuthorizationUrl() . '">Click here to authorize</a>';
}
echo $message;
echo $button;
?>
I also have a refresh.php script that re-generates the token every so number of days.
<?php
$infusionsoft = new \Infusionsoft\Infusionsoft(array(
'clientId' => 'xxx',
'clientSecret' => 'xxx',
'redirectUri' => $redirect_uri
));
if(($file = fopen(CB_ABS_PATH.'token.txt','r+')) == false)
{
echo 'File Failed to Open'.PHP_EOL;
}
else
{
$content = fread($file, 9999);
$infusionsoft->setToken(unserialize($content));
$content = $infusionsoft->refreshAccessToken();
echo serialize($content) . PHP_EOL;
ftruncate($file,0);
fseek($file,0);
fwrite($file,serialize($content));
fclose($file);
}
Using InfusionSoft PHP SDK version 1.4 while the latest is 1.65
Q: Do I need to change anything in my code to reflect the changes affected by Legacy Key sunsetting ?