Google Ads API - generateKeywordIdeas issue

69 views
Skip to first unread message

Sivanath

unread,
Aug 23, 2024, 6:06:11 AM8/23/24
to Google Ads API and AdWords API Forum
Hi Team,

We have used generateKeywordIdeas function to get Keywords and its working correctly to maximum accounts using PHP API. But recently it provides below error to particular accounts. Could you please help us to fix this?

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://oauth2.googleapis.com/token` resulted in a `400 Bad Request` response: { "error": "invalid_grant", "error_description": "Bad Request" } 

Thanks in Advance.

Google Ads API Forum Advisor

unread,
Aug 23, 2024, 10:02:39 AM8/23/24
to sivan...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Kindly note that the invalid_grant error usually indicates an issue with the refresh token. That said, you’ll need to regenerate credentials and refresh tokens. You may refer here to this guide for the steps on how you can regenerate credentials and refresh tokens. I would recommend you to kindly refer to the Generate tokens guide as it describes how to generate tokens for more information. You may refer to this document to Fetch a refresh token. Also, follow this guide to know more about the refresh token expiration. 

You can follow the following steps to fix this issue:
  • Go to the Google API Console and navigate to the OAuth consent screen
  • Change the publishing status to “In production”.
I hope this helps!

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vFHQQ:ref" (ADR-00264642)

Thanks,
 
Google Logo Google Ads API Team

 

Reply all
Reply to author
Forward
0 new messages