API Get user information

40 views
Skip to first unread message

Hải Long

unread,
Mar 15, 2023, 10:02:05 AM3/15/23
to Google Ads API and AdWords API Forum
There was a get_customer method on CustomerService in API v12, but now it is gone in v13 and I could not find any information about the updated method or sample code to get the customer details.
My old code on v12:
customer_service = client.get_service('CustomerService')
account_list = customer_service.list_accessible_customers().resource_names
all_accounts = []
for customer in account_list:
try:
customer_detail = customer_service.get_customer(resource_name=customer)
all_accounts.append(customer_detail)
except Exception as e:
logger.error(e)

Google Ads API Forum Advisor

unread,
Mar 15, 2023, 3:48:24 PM3/15/23
to jrbal...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for raising this concern to the Google Ads API support team.

Regarding your concern, can you confirm if what you want to get is the account data? If so, please note that the report to be used to get account-level data is the customer report. Kindly note that for you to know what fields are compatible or selectable to a specific report, you will need to select the 'Yes it is' option in the dropdown of a specific report. I would suggest using the customer_query_builder as this will greatly help you build and validate your query.

Additionally, you may check this Get Account Information code sample as it is specifically for pulling the account's data.

Regards,
Google Logo Google Ads API Team
​​​​​​​

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