invalid_grant error using AdWords Java client

35 views
Skip to first unread message

Diego Morello

unread,
Jun 24, 2021, 3:33:09 PM6/24/21
to AdWords API and Google Ads API Forum
Hi, I would like to ask for help with an AdWords API issue I'm experiencing 

I started getting the following error for some accounts:

{
  "error" : "invalid_grant",
  "error_description" : "Bad Request"
}

This started happening in one of our Java apps for 2 accounts under the same MCC, after logging in to Google Ads and storing the corresponding tokens. I was able to reproduce the error using the GetCampaigns.java example. It might be worth mentioning that we were able to authenticate correctly before repeating the auth flow.

Also, the "invalid_grant" error seems to be undocumented. It would be also great to add some info about it in AdWords documentation.

Thanks in advance for your help

Google Ads API Forum Advisor

unread,
Jun 28, 2021, 1:40:32 AM6/28/21
to diego....@gmail.com, adwor...@googlegroups.com

Hello Diego,

Thank you for raising this to us.

As for the error (invalid_grant), this signifies that the access or refresh token being passed in your request is incorrect or invalid. Since you've mentioned that you were able to authenticate correctly before repeating the auth flow, have you tried following the steps on this guide? In addition to that, so our team can better check on this, please share with us the details below via Reply privately to author option or via this email (googleadsa...@google.com).

  • complete SOAP logs (request and response with requestId)
  • Email address (used to generate those credentials)
  • Customer ID (used for the API request)

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


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