PHP Client Library : Problem to use API Adsword

575 views
Skip to first unread message

f.de...@webmarketing-booster.com

unread,
Jun 16, 2014, 6:00:56 PM6/16/14
to adwor...@googlegroups.com
Hello,

I'm currently trying to use the Adwords API PHP but I have trouble connecting. I downloaded the Seller GoogleAds-php-lib

I followed the guide for authentication via OAuth 2.0. I modified the file auth.ini indicating my developerToken my userAgent my client_id and my client_secret

When I execute the GetRefreshToken.php file via my browser with the following URL: http://localhost/site_web/googleads/examples/AdWords/Auth/GetRefreshToken.php

I have the following return:
Log in to your AdWords account and open the Following URL: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=XXXXXX-fn3lphn8rmm7uksvdrhjoimuc0j1bd9h.apps.googleusercontent.com&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 authorization token enter the code here: OAuth2 Your Credentials are incorrect. Please see the example GetRefreshToken.php. {"Error": "invalid_request", "error_description": "Missing required parameter: code"}

Following the url above, I get the authorization code well. But then where do you copy?

Thanks in advance

Florent

Josh Radcliff (AdWords API Team)

unread,
Jun 17, 2014, 1:38:26 PM6/17/14
to adwor...@googlegroups.com
Hi Florent,

All of the scripts in the examples folder are meant to be run from the command line, as they write to stdout and sometimes read from stdin. For example, the GetRefreshToken.php script will write a URL you'll need to use to get a code which you'll then have to enter at a subsequent prompt.

Cheers,
Josh, AdWords API Team 

Bzness Ads

unread,
Sep 12, 2014, 7:18:02 PM9/12/14
to adwor...@googlegroups.com
Having the same problem....

I get the code, but where do i put it?

Ray Tsang (AdWords API Team)

unread,
Sep 15, 2014, 12:49:30 PM9/15/14
to adwor...@googlegroups.com
Hi,

Please carefully review the AdWords API Authentication guide as well as the PHP client library OAuth guide.

Thanks,

Ray

Sage Lewis

unread,
Sep 24, 2014, 8:00:08 PM9/24/14
to adwor...@googlegroups.com
As a person who is VERY new to this world this was definitely a hurdle for me. 

I set up XAMPP on my pc at home. It installed php and all the necessary stuff right out of the box. But what I didn't realize was just what was said below. You must run these examples all from the command line. So it's not like you can just upload these libraries to Godaddy and get them to run. 

Running them on your local machine is probably the easiest approach.

But figuring out how to get php to run on command line was still a challenge. This post was key in getting me to be able to run a php script from command line:

Now I can get other examples to run as well. Hopefully you will too.

:)

On Monday, June 16, 2014 6:00:56 PM UTC-4, f.de...@webmarketing-booster.com wrote:

Anash P. Oommen (AdWords API Team)

unread,
Sep 25, 2014, 9:35:22 AM9/25/14
to adwor...@googlegroups.com
Hi Sage,

Have you explored AdWords scripts? It is much simpler to use than AdWords API, and may be the right product for you.

Cheers,
Anash P. Oommen,
AdWords API Advisor.
Reply all
Reply to author
Forward
0 new messages