How to connect Google Ads API through a proxy (google-ads-javalib)

410 views
Skip to first unread message

Vasvaroos Ngamdamrongkiat

unread,
Aug 22, 2019, 9:06:25 AM8/22/19
to AdWords API and Google Ads API Forum

I found this error log when I tried to connect Google Ads API.


Request
-------
MethodName: google.ads.googleads.v2.services.GoogleAdsService/Search
Headers: {developer-token=REDACTED, login-customer-id=5788147835, x-goog-api-client=gl-java/1.8.0_191 gapic/1.0 gax/1.0 grpc/1.0}
Body: [FAILED toString()]

Response
--------
Headers: null
Body: null
Failure message: null
Status: Status{code=UNAVAILABLE, description=io exception, cause=io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: null: googleads.googleapis.com/216.58.199.106:443
 


What I think it's because of proxy.

However I cannot find the solution how can I set the proxy in Java library. I found the solution for only PHP.

 

https://developers.google.com/google-ads/api/docs/client-libs/php/proxy

 

Could you figure out how to do it because I cannot find something like “.setProxy” method?


This is how we create the Google Ads client.

 


GoogleAdsClient
    .newBuilder()

    .fromProperties(oauthProperties)

    .build()



 

Google Ads API Forum Advisor Prod

unread,
Aug 22, 2019, 1:16:35 PM8/22/19
to vasv...@gmail.com, adwor...@googlegroups.com
Hello Vasvaroos,

You could refer the issue here, which might help with you question on proxy setting for Java client library. If you are still acing the issue you can raise an issue on our client library from here, Our client library owners are better equipped to assist you with these concerns.

Regards,
Sai Teja, Google Ads API Team

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