Google Ads API authentication error. No customer found for token with basic access level

1,347 views
Skip to first unread message

Сергей Хоменко

unread,
Mar 27, 2019, 11:48:26 PM3/27/19
to AdWords API and Google Ads API Forum
Hi. I have an account with access to Ads API and developer token, approved and having basic access level. 

In documentation it means, that i have an access to production account.

I have built an application to generating reports for campaigns, but i can't auhtenticate user. API throws AuthorizationError.NO_CUSTOMER_FOUND  error.

I use PHP 7.1.14. Inside the $token i have a response from google oauth page.

Here is how i do request for get campaigns list.

$oAuthCreds = (new OAuth2TokenBuilder())
 
->withClientId(App::CLIENT_ID)
 
->withClientSecret(App::CLIENT_SECRET)
 
->withRefreshToken($token->refresh_token)
 
->build();
 $session
= (new AdWordsSessionBuilder())
 
->withOAuth2Credential($oAuthCreds)
 
->withDeveloperToken('XXXXXXXXXXXXX')
 
->build();

 $services
= new AdWordsServices();

 
/** @var CampaignService $campaignService */
 $campaignService
= $services->get($session, CampaignService::class);
 $selector
= new Selector();
 $selector
->setFields(['Id', 'Name']);
 $selector
->setOrdering([new OrderBy('Name', SortOrder::ASCENDING)]);
 $selector
->setPaging(new Paging(0, 20));

 
/** @var CustomerService $customerService */
 $customerService
= $services->get($session, CustomerService::class);

 
try {
 $campaignList
= $campaignService->get($selector)->getEntries();

 
} catch (Throwable $e) {
 echo $e
->getMessage();
 
}

googleadsapi...@google.com

unread,
Mar 28, 2019, 3:44:13 AM3/28/19
to adwor...@googlegroups.com
Hi Сергей,

The AuthorizationError.NO_CUSTOMER_FOUND error is occurring when you are passing an incorrect/non-existing client customer ID on the request header of your transaction. With this, you may try to confirm on your end if the client customer ID is existing. If you can confirm that it is indeed existing and the error is still persisting, kindly provide the client customer ID or provide the complete SOAP request and response so I can further check.

If you haven't enable the SOAP logs yet, kindly enable it by following this guide for PHP library supported by AdWords API.

Regards,
Ejay
Google Ads API Team

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/2583aba9-e4ab-4450-a621-b24cdf5b1d8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages