repeatedly getting oauth2 error using google-ads java lib

225 views
Skip to first unread message

Shubham Srivastava

unread,
Mar 13, 2021, 12:50:44 PM3/13/21
to AdWords API and Google Ads API Forum
Hi team, I'm trying to use google-ads java library with the sample GetCampaigns code. I'm repeatedly getting below error:

Status: Status{code=UNAVAILABLE, description=Credentials failed to obtain metadata, cause=com.google.api.client.http.HttpResponseException: 400 Bad Request
{
  "error": "invalid_grant",
  "error_description": "Account has been deleted"
}
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1113)
at com.google.auth.oauth2.UserCredentials.refreshAccessToken(UserCredentials.java:203)
at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:145)
at com.google.auth.oauth2.UserCredentials.getRequestMetadata(UserCredentials.java:281)
at com.google.auth.Credentials.blockingGetToCallback(Credentials.java:112)
at com.google.auth.Credentials$1.run(Credentials.java:98)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
}.

The same credentials are working with python adwords client

Google Ads API Forum Advisor Prod

unread,
Mar 15, 2021, 12:44:10 PM3/15/21
to shu...@onequince.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. Can you please confirm if your OAuth credentials and refresh token are properly set in your ads.properties file? Can you also please provide us with the customer ID? Please reply privately from here as your responses may contain sensitive information. 

Thanks,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


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