I have even used example from library: GetRefreshToken.php

This is the output:

/usr/local/bin/php /path/to/app/vendor/googleads/googleads-php-lib/examples/
AdWords/Auth/GetRefreshToken.php
Log in to your AdWords account and open the following URL:
https:
//accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fmysite.tld%2Fintegrate%2Fadwords&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&access_type=offline


After approving the token enter the authorization code here: 4/
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


PHP Notice:  Undefined index: refresh_token in /path/to/app/vendor/googleads
/googleads-php-lib/examples/AdWords/Auth/GetRefreshToken.php on line 90
Notice: Undefined index: refresh_token in /path/to/app/vendor/googleads/
googleads-php-lib/examples/AdWords/Auth/GetRefreshToken.php on line 90
PHP Stack trace:


PHP   1. {main}() /path/to/app/vendor/googleads/googleads-php-lib/examples/
AdWords/Auth/GetRefreshToken.php:0
Call Stack:
PHP Notice:  Undefined index: refresh_token in /path/to/app/vendor/googleads
/googleads-php-lib/examples/AdWords/Auth/GetRefreshToken.php on line 92
    0.0008     241592   1. {main}() /path/to/app/vendor/googleads/googleads-
php-lib/examples/AdWords/Auth/GetRefreshToken.php:0


Your refresh token is: 


Notice: Undefined index: refresh_token in /path/to/app/vendor/googleads/
googleads-php-lib/examples/AdWords/Auth/GetRefreshToken.php on line 92


Call Stack:
    0.0008     241592   1. {main}() /path/to/app/vendor/googleads/googleads-
php-lib/examples/AdWords/Auth/GetRefreshToken.php:0


In your auth.ini file, edit the refresh_token line to be:
refresh_token = ""
PHP Stack trace:
PHP   1. {main}() /path/to/app/vendor/googleads/googleads-php-lib/examples/
AdWords/Auth/GetRefreshToken.php:0


Process finished with exit code 0


On Wednesday, December 7, 2016 at 3:44:11 PM UTC+1, Sebastian Piskorski 
wrote:
>
> I send following request: 
> https://accounts.google.com/o/oauth2/v2/auth?approval_prompt=force&response_type=code&client_id=xxxxxxxx-xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fpanel.piwik.pro%2Fintegrate%2Fadwords&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&access_type=offline&state=xxxx-xxx-xxx-xxx
>
> User selects his account and authenticate my application to use his 
> AdWords data. In response I get code 
> https://mysite.tld/integrate/adwords?state=xxx-xxx-xxxx&code=4/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx#
>
> And my service process this code passing it to Google SDK. Using 
> `SimpleOAuth2Handler` method `GetAuthorizationUrl` is called. Goolge SDK 
> then tries to obtain token sending following request, but response have no 
> refresh_token.
>
> https://www.googleapis.com/oauth2/v4/token?code=4%2Fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&client_id=xxxxxxxx-xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&client_secret=xxxxx-xxxxxxxxxxxxxxxxxx&redirect_uri=https%3A%2F%2Fmysite.tld%2Fintegrate%2Fadwords&grant_type=authorization_code
>
> Example response body:
> {
>  "access_token": 
> "ya29.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
> ,
>  "token_type": "Bearer",
>  "expires_in": 3341
> }
>
>
> I use google-php-lib v201605.
>
> How to obtain refresh_token. What do I miss?
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/76f37c2a-392f-4903-b373-967274663820%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • I can't obtain ... Sebastian Piskorski
    • Re: I can'... Sebastian Piskorski
      • Re: I ... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
        • Re... Sebastian Piskorski

Reply via email to