Correct way to retrieve users from AdWords API

89 views
Skip to first unread message

Martin Geubelle

unread,
Jan 15, 2015, 7:48:03 AM1/15/15
to adwor...@googlegroups.com
Hi there,

I was wondering about the proper way of getting the CustomerId of an account in all cases using the API. First, I was using the service "ManagedCustomerService" and that worked well for my accounts, until I noticed that I couldn't get accounts that were not managed by MCC (if I understood well). I then used ''CustomerService'' if nothing was returned by the first service. Is this the correct way to do that ?

Cheers,


Martin

Josh Radcliff (AdWords API Team)

unread,
Jan 15, 2015, 10:17:27 AM1/15/15
to adwor...@googlegroups.com
Hi Martin,

The difference between CustomerService.get and ManagedCustomerService.get is as follows:
  • The Customer object you get back from CustomerService.get depends on the presence or absence of the clientCustomerId SOAP header in your request.
    • If clientCustomerId is set, then you will get back the Customer object for that customer (Customer.customerId will be equal to clientCustomerId)
    • If clientCustomerId is not set, then you will get back the Customer object for the customer associated with your OAuth credential's account. If your OAuth credentials are for your MCC, you'll get back the Customer object for your MCC. If your OAuth credentials are for a specific client account, you'll get back the Customer object for that client account.
  • The ManagedCustomer objects you get back from ManagedCustomerService.get will be the set of customers managed by the account specified in the clientCustomerId SOAP header.
Hopefully that clears things up, but let me know if I missed anything.

Cheers,
Josh, AdWords API Team

Martin Geubelle

unread,
Jan 15, 2015, 10:34:31 AM1/15/15
to adwor...@googlegroups.com
Dear Josh,

Thank you very much for you answer, it takes on its full meaning for me now ! I really appreciate.

Cheers,

Martin
Reply all
Reply to author
Forward
0 new messages