Hi Tim, 

You need to use OAuth2TokenBuilder 
<https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/Common/OAuth2TokenBuilder.php#L67>
 
and AdWordsSessionBuilder 
<https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/AdWords/AdWordsSessionBuilder.php#L104>
 
to pass the values programmatically. 

    $oAuth2Credential = (new OAuth2TokenBuilder())
      ->withClientId("OAUTH_2_CLIENT_ID")
      ->withClientSecret("OAUTH_2_CLIENT_SECRET")
      ->withRefreshToken("REFRESH_TOKEN")
      ->build();

    // Construct an API session configured from the OAuth2 credentials 
above.
    $session = (new AdWordsSessionBuilder())
        ->withDeveloperToken("DEVELOPER_TOKEN")
        ->withOAuth2Credential($oAuth2Credential)
        ->withClientCustomerId("CLIENT_CUSTOMER_ID")
        ->build();


The first section builds OAuth2 access token fetchers, which will get 
access tokens as and when required. You need to use the oAuth2Credential 
object when you build a AdsSession in the PHP client library. I hope this 
helps. If you have any further questions, I would suggest that you post on 
the library's issue tracker 
<https://github.com/googleads/googleads-php-lib/issues> so the library 
owners can help you out. 

Regards,
Shwetha, 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 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 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/57873080-b23a-4159-9672-e2ac4b85ff5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • PHP ... Tim Johnson
    • ... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
      • ... Tim Johnson
        • ... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
          • ... Jean-Fabrice Rabaute
            • ... Jean-Fabrice Rabaute
              • ... 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
                • ... Jean-Fabrice Rabaute
                • ... 'Josh Radcliff (AdWords API Team)' via AdWords API Forum
            • ... 'Thanet Knack Praneenararat (AdWords API Team)' via AdWords API Forum

Reply via email to