RE: Authorization error on basic access token

2019-03-28 Thread googleadsapi-forumadvisor via AdWords API and Google Ads API Forum


Hi,

I had to delete your initial post as you have included confidential
information. Please refer to our forum posting guidelines
  
to

avoid such instances.

Regarding your concern, could you send to me in private (via the *Reply
privately to author* option) your clientCustomerId and the complete SOAP
request and response logs so I can further investigate?

If you have not enabled SOAP logging, kindly refer to this guide
.

Thanks and regards,
Peter
Google Ads API Team

On 03/28/19 19:26:20 adpointbetreu...@gmail.com wrote:

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('Y9zu18RKfWDPpNVZRmNYmg')
->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 {
$canpaignList = $campaignService->get($selector)->getEntries();
} catch (Throwable $e) {
echo $e->getMessage();
}

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@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/02875b71-3522-49d8-9b59-f2ba1aa76157%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@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/19hee100gqv66k0015509ew60mjae1l60o30c1g68qjicpp%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Authorization error on basic access token

2019-03-28 Thread Ad
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('Y9zu18RKfWDPpNVZRmNYmg')
->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 {
$canpaignList = $campaignService->get($selector)->getEntries();
} catch (Throwable $e) {
echo $e->getMessage();
}

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@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/02875b71-3522-49d8-9b59-f2ba1aa76157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.