Hi,
As you can see in this section
<https://github.com/googleads/googleads-php-lib/blob/master/README.md#user-content-basic-usage>,
if you don't want to use the property file, then you need to set the OAuth2
fields in the OAuth2TokenBuilder
<https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/Common/OAuth2TokenBuilder.php>
and AdWordsSessionBuilder
<https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/AdWords/AdWordsSessionBuilder.php>
objects.
See sample code snippet below:
$oAuth2Credential = (new OAuth2TokenBuilder())
//->fromFile()
->withClientId('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
->withClientSecret('XXXXXXXXXXXXXXX')
->withRefreshToken('XXXXXXXXXXXXX')
->build();
// Construct an API session configured from a properties file and the
OAuth2
// credentials above.
$session = (new AdWordsSessionBuilder())
//->fromFile()
->withOAuth2Credential($oAuth2Credential)
->withClientCustomerId('XXX-XXX-XXXX')
->withDeveloperToken('XXXXXXXXXXXXXXXXXX')
->build();
self::runExample(new AdWordsServices(), $session);
Thanks,
Vincent
AdWords API Team
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords 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 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/ddd725aa-58d4-49fc-92fe-91cd4a924f9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.