Hi Sibtain,
If you are trying to fetch all of the accounts associated to your email address, you may use CustomerService.getCustomers() without specifying a clientCustomerId. This should return up to 5 accounts which your OAuth2 credentials (generated using your email) has direct access. You may also check this blog post for your reference.
With regard to the difference between the ManagedCustomerService and CustomerService, ManagedCustomerService.get() should return all sub accounts with specifying an MCC as the clientCustomerId in the request header (You may refer to this sample). CustomerService will return only the customer information based on the clientCustomerId, or the accounts associated to the OAuth2 credentials.
Please let me know if you have further concern.
Regards,
Hiroyuki
Google Ads API Team
Hi James,
I'm sorry for the inconvenience.
Could you confirm if what you are looking for is the sample PHP code for CustomerService.getCustomers()? If yes, unfortunately, we don't have exact code samples for that. With this, I would recommend you to reach out to the PHP client library owner via this link as they may provide the specific sample code that you are looking for.
Please let me know if you have further clarification.
Regards,
Hiroyuki
Google Ads API Team
Hi James,
Could you confirm if what you are using is AdWords API or Google Ads API? The first one (https://github.com/googleads/google-ads-php) is for Google Ads API, and the other one (https://github.com/googleads/googleads-php-lib) is for AdWords API. Please use those client libraries depending on the API you are using.
Let me know if this helps and you may write back if you have any additional concerns.
Regards,
Hiroyuki
Google Ads API Team
Hi,
Could you confirm if the error you encountered is AuthenticationError.CUSTOMER_NOT_FOUND error? If yes, it means that the account was not found for the customer ID provided in the header. However, to further investigate this, could you provide the complete SOAP request and response logs for both CustomerService.getCustomers() and ManagedCustomerService.get() via Reply privately to author?
Regards,
Hiroyuki
Google Ads API Team
Hi Sibtain,
Thank you for providing the responses and I'm sorry for the confusion.
Upon checking the ManagedCustomerService is working correctly as the client account (138-664-0593) is indeed the only account associated under the MCC account (447-120-0739), and the service returned the account correctly.
With regard to Customer Service, I couldn't see the error in the log you provided. With this, so I can further investigate the issue, could you provide the complete SOAP request and response logs via Reply privately to author? If you haven't enabled logging, please check the logging guide in the respective client library for steps to enable logging.
Regards,
Hiroyuki
Google Ads API Team