Hello Nik, 

For the PHP client library, it is highly recommended that you use 
adsapi_php.ini file to set the OAuth2 credentials. If you don't want to or 
can't use one, you can use the OAuth2 token and ads session builders 
instead to set the same information. Please check this guide 
<https://github.com/googleads/googleads-php-lib#basic-usage> for more 
information. Once you have these credentials set up, you will be able to 
run the code samples listed here 
<https://developers.google.com/adwords/api/docs/samples/php/basic-operations>
. 

Let me know if you have any other questions. 

Regards,
Bharani, AdWords API Team

On Monday, June 4, 2018 at 2:02:00 PM UTC-4, nnik wrote:
>
> Hi folks, 
>
> I want to ask the adwords api to request my campaigns.
>
> I am using this simple example:
>
> $redirectUri = 'http://xxxxxxx/dashboard/accounts/oauth2callback';
> $code = $_GET['code'];
>
> $oauth2 = new OAuth2([
>     'authorizationUri' => 'https://accounts.google.com/o/oauth2/v2/auth',
>     'tokenCredentialUri' => 'https://www.googleapis.com/oauth2/v4/token',
>     'redirectUri' => $redirectUri,
>     'clientId' => $this->client_id,
>     'clientSecret' => $this->client_secret,
>     'scope' => '****'
> ]);
>
> $oauth2->setCode($code);
> $authToken = $oauth2->fetchAuthToken();
>
> // Store the refresh token for your user in your local storage if you
> // requested offline access.
> $refreshToken = $authToken['refresh_token'];
> Now I have the access_token and the refresh_token.
>
> How can I use this to request google adwords now? When I am checking this 
> example: 
> https://developers.google.com/adwords/api/docs/samples/php/basic-operations
>
> The authentication data is coming from some local file, but I have the 
> data in my array above and the tokens are coming from the DB. 
>
> Thanks
> Nik
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/f20bd115-051e-4ec0-8107-cf38d162b43d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... nnik
    • ... 'Bharani Cherukuri (AdWords API Team)' via AdWords API and Google Ads API Forum
    • ... Peter Bowen

Reply via email to