Hi Team
I am switching to the new Google Ads Api library and get some trouble with the Refresh Token.
I am using this code in php :
try {
$clickConversion = new ClickConversion([
'conversion_action' =>
ResourceNames::forConversionAction($customerId, $conversionActionId),
'gclid' => $gclid,
'conversion_value' => $conversionValue,
'conversion_date_time' => $conversionDateTime,
'currency_code' => 'EUR'
]);
$conversionUploadServiceClient = $googleAdsClient->getConversionUploadServiceClient();
/** @var UploadClickConversionsResponse $response */
$response = $conversionUploadServiceClient->uploadClickConversions(
$customerId,
[$clickConversion],
true
);
And using a google_ads_php.ini with the value of the refresh token.
It works during 7 days but after, I get the refresh token denied.
API Error:
GuzzleHttp\Exception\ClientException: Client error: `POST
https://oauth2.googleapis.com/token` resulted in a `400 Bad Request` response:
{
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."
}
"Auto-refresh token before it expires" is also ticked on the Google Developers Console.
So my question is :
How can I get a refresh token without using the Google Developers console ?
Or how can I get this refresh token automatically refreshed ?
Thanks for your help