Trying to execute the GetKeywordIdeas.php but unsuccessful using Test Accounts

393 views
Skip to first unread message

mit...@email.sapnagroup.net

unread,
Dec 2, 2013, 5:37:37 AM12/2/13
to adwor...@googlegroups.com
Hi All,

I have been trying to execute the GetKeywordIdeas.php it. But when I try to execute the file it gives error and returns "An error has occurred: { "error" : "invalid_client" }


These are the details used in \src\Google\Api\Ads\AdWords\auth.ini file

developerToken = "APPROVAL PENDING TOKEN FROM GOOGLE ADWORDS API"
userAgent = "MY COMPANY NAME"

client_id = "ID GENERATE USING GOOGLE CONSOLE WITH THE MCC account EMAIL ID"
client_secret = "SECRET GENERATE USING GOOGLE CONSOLE WITH THE MCC account EMAIL ID"

Also when I run the GetRefreshToken.php , I get this error:

Log in to your AdWords account and open the following URL: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=ID GENERATE USING GOOGLE CONSOLE WITH THE MCC account EMAIL ID&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fadwords.google.com%2Fapi%2Fadwords%2F&access_type=offline After approving the token enter the authorization code here: Your OAuth2 Credentials are incorrect. Please see the GetRefreshToken.php example. { "error" : "invalid_request" }

On executing this url it says
Error: redirect_uri_mismatch

Not sure what is going wrong here.  Since it says 'Your OAuth2 Credentials are incorrect.' does it mean the credentials are not correctly generated?

Kind regards,

Mithila

Josh Radcliff (AdWords API Team)

unread,
Dec 6, 2013, 3:28:43 PM12/6/13
to adwor...@googlegroups.com
Hi Mithila,

When you created the application in the Cloud Console, did you create a Native Application?  The redirect_uri_mismatch suggests that you may have used a different application type.  Per the step by step OAuth2 PHP guide, the sample requires Native Application.

Thanks,
Josh, AdWords API Team

mat...@rectusmedia.com

unread,
Sep 16, 2016, 9:18:01 AM9/16/16
to AdWords API Forum
Hi Josh,



Try to use "Other" and before that "Web application", does not work, I get from PHP-LIB examples.

An error has occurred: { "error": "invalid_user", "error_description": "Bad Request" }

Also when I run GetRefreshToken.php return text ends with:

After approving the token enter the authorization code here: Your OAuth2 Credentials are incorrect. Please see the GetRefreshToken.php example. { "error": "invalid_request", "error_description": "Missing required parameter: code" }

I open link, give access, but still does not work like that.


Any ideas?

Josh Radcliff (AdWords API Team)

unread,
Sep 18, 2016, 6:03:21 PM9/18/16
to AdWords API Forum
Hi,

The GetRefreshToken.php example (as well as the other examples in the library) is designed to be run on the command line, since it contains steps that prompt you for input. Is that how you are running it?

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