Communauté
Demande token ok sandbox mais pas production
28 days ago by Stéphane
Bonjour,
J'ai développé les appels API en sandbox, cela fonctionnait bien.
Mais quand j'essaye en production j'ai un soucis déjà pour obtenir le token.
J'utilise bien l'url de prod : https://api.helloasso.com/oauth2/token
J'utilise bien les bons Client ID et Secret du compte de production
J'obtiens l'erreur : "unauthorized_client"
Cf mon code PHP qui fonctionnait bien en sandbox, et j'ai bien changer les Client IDs et URL token
$strParamPostToken = "grant_type=client_credentials&client_id=".HELLOASSO_CLIENT_ID_PROD.
"&client_secret=".HELLOASSO_CLIENT_SECRET_PROD;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, HELLOASSO_URL_TOKEN_PROD);
curl_setopt($curl, CURLOPT_MAXREDIRS, 10);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('content-type: application/x-www-form-urlencoded'));
curl_setopt($curl, CURLOPT_POSTFIELDS, $strParamPostToken);
$result = curl_exec($curl);
curl_close($curl);
Merci de votre aide