J'ai besoin d'accéder à infusionsoft api sans interaction de l'utilisateur. Je ne veux pas laisser l'utilisateur cliquer sur un clic pour que je puisse obtenir un tocken. C'est possible?infusionsoft - Comment obtenir un token sans cliquer sur le lien?
$infusionsoft = new Infusionsoft\Infusionsoft(array(
'clientId' => '...',
'clientSecret' => '...',
'redirectUri' => '...',
));
// If the serialized token is available in the session storage, we tell the SDK
// to use that token for subsequent requests.
if (isset($_SESSION['token'])) {
$infusionsoft->setToken(unserialize($_SESSION['token']));
}
// If we are returning from Infusionsoft we need to exchange the code for an
// access token.
if (isset($_GET['code']) and !$infusionsoft->getToken()) {
$infusionsoft->requestAccessToken($_GET['code']);
}
if ($infusionsoft->getToken()) {
// Save the serialized token to the current session for subsequent requests
$_SESSION['token'] = serialize($infusionsoft->getToken());
// MAKE INFUSIONSOFT REQUEST
} else {
echo '<a href="' . $infusionsoft->getAuthorizationUrl() . '">Click here to authorize</a>';
}
Je suis dans la même situation. Notre cas d'utilisation est que nous devons récupérer nos commandes afin que nous puissions les gérer via notre propre administrateur centralisé. – cyberwombat