400 Bad Request invalid_grant

493 views
Skip to first unread message

Amol Kawale

unread,
Nov 2, 2022, 9:50:32 AM11/2/22
to Google Ads API and AdWords API Forum
Hello Team,

We try to execute get keyword suggestion API & locations API in google ads but we getting the following issues:

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": "Token has been expired or revoked." } 

I tried to generate refresh token as well but it giving me error as follows:

Pls help to fix me.

Regards,
Amol

Google Ads API Forum Advisor

unread,
Nov 2, 2022, 12:08:09 PM11/2/22
to adwor...@googlegroups.com
Hi Amol,

The invalid_grant error is likely caused by the refresh token issue you are having. Can you please tell us what steps you are taking to generate a refresh token? For example, if you are using a client library, you can generate a refresh token by running the GenerateUserCredentials example. 

If you continue seeing the error in the screenshot, please click 'error details' and provide us with those details.

Thanks,

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2fzJ0N:ref
Reply all
Reply to author
Forward
0 new messages