redirect_uri_mismatch Application

679 views
Skip to first unread message

Michael Barlow

unread,
Mar 24, 2015, 1:38:04 PM3/24/15
to adwor...@googlegroups.com

Hope someone can help.

Im attempting to set up a test environment to interact with Google adword campaigns using php.

I've downloaded the Google Ads APIs Client Library for PHP and entered my developerToken, userAgent, clientCustomerId, client_id and client_secret as per the instructions (https://github.com/googleads/googleads-php-lib)

I've ran GetRefreshToken.php via php in console and visited the link it generated but it just says

400. Thats an error. Error: redirect_uri_mismatch Application: Google Statistics

I researched the error and it said i needed to have the correct REDIRECT URIS in my Google Developer Console. I've tried lots of variations but nothing seems to work. It's currently set at:

http://localhost:8888/

I'm running the API on localhost using MAMP, what should the redirect URI be?

Thanet Knack Praneenararat (AdWords API Team)

unread,
Mar 26, 2015, 1:51:44 AM3/26/15
to adwor...@googlegroups.com
Hi Michael,

It's highly likely that you have problems with setting up you OAuth2 stuff.
Please double-check the guide and follow carefully again.

Typically, you shouldn't need to fiddle with redirect URIs, it should just be the default when you create a project on the developer's console.
You may need to check your developer console settings again.

Unfortunately as this is related to security issues, we cannot diagnose OAuth2 problems from our side.
However, I suspect that there might be some mistakes in settings of developer console and/or OAuth2 steps themselves,
as the error "Application: Google Statistics" seems not related to AdWords API.

Please let me know if you have any other issues.

Cheers,
Thanet, AdWords API Team

Anash P. Oommen (AdWords API Team)

unread,
Mar 26, 2015, 4:01:08 PM3/26/15
to adwor...@googlegroups.com
Hi Michael,

I would recommend checking your OAuth2 console project once more - ensure that it is of type "Installed application" as mentioned on https://github.com/googleads/googleads-php-lib/wiki/Using-OAuth-2.0#creating-an-application-identifier.

Cheers,
Anash P. Oommen,
AdWords API Advisor.
Message has been deleted

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Apr 16, 2018, 5:34:18 PM4/16/18
to AdWords API Forum
Hi, 

Re-posting your question without the screenshot as it contained OAuth credentials. In the future, please make sure that sensitive information is not shared on the public forum. Please check this post for the guidelines while posting on this forum. 

"I have generated API token through google console. In that I have added a Reidrect URL. But when I am running command from generating refresh token for google adwords APi. I am getting redirect_url_mismatch error. Below I have attached screenshot of it."

Thanks,
Sreelakshmi, AdWords API Team

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Apr 16, 2018, 5:35:13 PM4/16/18
to AdWords API Forum
Hi, 

You will have to make sure that the redirect uri for the credentials of type Web is set correctly in the Google API Console Credentials page and it matches the one set in your code (please check the link for Java code sample). If it is not same, could you please update this and retry? If you are still facing issues, could you please create a new thread as this a very old thread? 
Reply all
Reply to author
Forward
0 new messages