How to get all customer names for manager accout on GoogleAds api? (Java)

30 views
Skip to first unread message

n...@albert.ai

unread,
Apr 23, 2019, 6:38:26 AM4/23/19
to AdWords API and Google Ads API Forum
There's so much information online for AdWords API but almost nothing for the Google Ads.
Everywhere I look I see suggestions to use CustomerService.getCustomers() but this command is meaningless when working with Google Ads api, because you need an AdWordsSession instance.

WIth the code below I can manage to extract their ID somehow off the GoogleAdsRow but can't find their name:

try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {

      String query = "SELECT customer.id, customer.descriptive_name, customer_client.resource_name, customer_client.client_customer, customer_client.level, customer_client.hidden FROM customer_client";
      SearchGoogleAdsRequest request = SearchGoogleAdsRequest.newBuilder().setCustomerId(Long.toString(customerId)).setPageSize(PAGE_SIZE).setQuery(query).build();
      SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);

      for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) {
      Customer customer = googleAdsRow.getCustomer();
      System.out.println(customer.???);
      }
}

The information contained in this communication and its attachments is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It is the property of Albert and may contain confidential or legally privileged information. If you are not the intended recipient you are hereby notified that any disclosure, copying, retention, printing or distribution of this communication or any part thereof, or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by responding to this email and then delete all copies of it from your system. Albert is not liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt.

googleadsapi...@google.com

unread,
Apr 23, 2019, 10:49:20 AM4/23/19
to n...@albert.ai, AdWords API and Google Ads API Forum
Hello,

Unfortunately, it's currently not possible to get the customer names of the accounts under your manager using Google Ads API. Our team is currently working on adding this feature.

Please follow our blog for any updates.

Regards,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/254b24a5-2197-4fdf-8b10-3d1b72c3a26c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages