How to get refresh OAUTH2 refresh token for AdWords API

1,469 views
Skip to first unread message

repka...@gmail.com

unread,
Dec 5, 2014, 11:40:56 AM12/5/14
to adwor...@googlegroups.com
Hello!
I have a problem with oauth2 refresh token in my AdWords auth.ini file:

; If you already have a refresh token, enter it below. Otherwise run
; GetRefreshToken.php.
refresh_token = "INSERT_OAUTH2_REFRESH_TOKEN_HERE"

I was trying to run GetRefreshToken.php file, and I received the next:
"Log in to your AdWords account and open the following URL https://accounts.google.com.... After approving the token enter the authorization token here:" 

But when I log in to my AdWords account and open this link, I have the next error: "400. That’s an error.Error: redirect_uri_mismatch".

How can I solve this problem???

Josh Radcliff (AdWords API Team)

unread,
Dec 8, 2014, 9:33:08 AM12/8/14
to adwor...@googlegroups.com
Hi,

When you created your application in the Google Developers Console, which type of application did you specify? The code example is designed to work with an Installed/native application. The error suggests that your application is a Web application, in which case the redirect URI used in the example won't match your application's redirect URI. If you create and use an Installed application instead then the example should work as expected.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages