GoogleAdsServiceClient.search hangs instead of erroring if LoginCustomerId is wrong

538 views
Skip to first unread message

Tim

unread,
Oct 22, 2020, 12:19:58 PM10/22/20
to AdWords API and Google Ads API Forum
Using the Google Ads API, if you call search() on a GoogleAdsServiceClient where the GoogleAdsServiceClient has a LoginCustomerId set one that does not have access to the CustomerId used in the search query, then instead of erroring it appears the query never returns.

In Google Ads API version 2 this would error with an unauthorised GoogleAdsException, in the latest version it just hangs. Is this a bug?

Example

GoogleAdsClient googleAdsClient = GoogleAdsClient
.newBuilder()
.setLoginCustomerId(managerAccountId)
.setDeveloperToken(getDeveloperToken())
.setCredentials(getCredentials())
.setEnableGeneratedCatalog(false)
.build();

String query = "SELECT customer_client.resource_name FROM customer_client LIMIT 1";
SearchGoogleAdsRequest request = SearchGoogleAdsRequest
.newBuilder()
.setCustomerId(Long.toString(childAccountId))
.setPageSize(1)
.setQuery(query)
.build();

try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
googleAdsServiceClient.search(request);
}

Google Ads API Forum Advisor Prod

unread,
Oct 22, 2020, 10:47:27 PM10/22/20
to tim....@valtech.com, adwor...@googlegroups.com
Hi Tim,

Thanks for posting your concern.

There is no known issue that is related to what you've raised on this post. With this, could you try this sample code in Java which using the latest API version, as v2 API version is already deprecated, and update the queries in the report?

Let me know how it goes after trying the sample code and provide the complete logs generated on your end together with the customer-id and login-customer-id that you used. You can provide the requested details via Reply privately to author option.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


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