Google Ads API - error handling while Authenticated error

57 views
Skip to first unread message

cv

unread,
May 14, 2019, 9:42:44 AM5/14/19
to AdWords API and Google Ads API Forum
Hello,

I am writing this post separately as suggested over here.
I was getting UNAUTHENTICATED error for a valid customerId when I ran a getCustomer service, which is based on list of account received from ListAllAccounts service.
I have around 20 accounts there which was listed from ListAccesibleCustomers service. I just wanted to list out all the accounts that can be managed by my main MCC account.

To do this process I need to cache the UNAUTHENTICATED error, but seems like GoogleAdsException is not caching those errors.

Code is like this.

       
$customerServiceClient = $googleAdsClient->getCustomerServiceClient();
$accessibleCustomers
= $customerServiceClient->listAccessibleCustomers();


       
foreach ($accessibleCustomers->getResourceNames() as $resourceName) {
           
           
try {
                $customer
= $customerServiceClient->getCustomer($resourceName);
                $customerId
= ($customer->getId() != '') ? $customer->getId()->getValue() : '';
           
} catch (GoogleAdsException $e) {
               
throw $e;
           
}
       
}


Thanks,



googleadsapi...@google.com

unread,
May 14, 2019, 5:42:55 PM5/14/19
to AdWords API and Google Ads API Forum
Hello Chirag,

I was able to catch the GoogleAdsException in Java. I am not well versed with PHP, I recommend you to post your concern on the PHP client library issue tracker for coding related issues.

Regards,
Sai Teja, 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/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_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/d4fadd02-ad9d-471f-adf8-f501d4e0b4de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages