Adwords API CustomerService CUSTOMER_NOT_FOUND

261 views
Skip to first unread message

James

unread,
May 11, 2017, 1:19:25 AM5/11/17
to AdWords API Forum
Hi 

After a client trying to connect their Adwords account to our application goes through the OAuth2 flow and we are able to get a valid access token and refresh token, I am trying to get all of the customers for that account using AdwordsService CustomerService. However when I do so, I am getting a CUSTOMER_NOT_FOUND error. I am trying to get all of the valid customers so I did not set the clientCustomerId as mentioned in the docs. https://developers.google.com/adwords/api/docs/reference/v201607/CustomerService

Here is my code:
   CustomerService customerService = (CustomerService)user.GetService(AdWordsService.v201607.CustomerService);
  var allCustomers = customerService.getCustomers();

Online resources say that this error occurs if the Adwords Account is newly created, but the client is saying that their account is not newly created. Has been around for at least 2 months.

Is there any other reason why this error would occur?

Thank you
James

James

unread,
May 11, 2017, 1:19:25 AM5/11/17
to AdWords API Forum
Hi

After a customer goes through the OAuth2 flow and we have a valid accesstoken and refreshtoken, I am trying to use the AdwordsService CustomerService object to get all of the valid Customers for a client but I keep on getting a CUSTOMER_NOT_FOUND error every time I call the getCustomers() method. Since we are not specifying the clientCustomerId header, we are expecting to get all of the customers as explained in this doc. https://developers.google.com/adwords/api/docs/reference/v201607/CustomerService

Here is the code that I am using
  CustomerService customerService = (CustomerService)user.GetService(AdWordsService.v201607.CustomerService);
  var allCustomers = customerService.getCustomers();

Most of the docs online about this issue suggest that this error occurs because the Account was newly created. 

However the client trying to connect their account said that their account was created about 2-3 months ago.

Is there any other reason why this CUSTOMER_NOT_FOUND error would occur.

Thank you
James


Ivan Bautista

unread,
May 11, 2017, 4:15:02 AM5/11/17
to AdWords API Forum
Hi James,

If you want to retrieve information of all client accounts under your MCC account, then I suggest that you use ManagedCustomerService instead. You may refer to this code sample for reference.

However, to help us narrow down the root cause of the error, could you reply to us privately (using reply privately to author option) with the SOAP request and response captured when error was encountered?

Also, were you able to reproduce the error even with the latest API version (201702)?

Regards,
Ivan 
AdWords API Team
Reply all
Reply to author
Forward
0 new messages