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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
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.