Issues with Authentication

69 views
Skip to first unread message

Ethan Lyon

unread,
Dec 27, 2014, 9:27:09 PM12/27/14
to adwor...@googlegroups.com
Hi There,

Not entirely sure why, but whenever I load a script from the php library, it returns nothing. I'm thinking it's an issue with authentication. Here are the steps I followed:

  1. Uploaded https://github.com/googleads/googleads-php-lib to a folder on my domain (e.g. http://dev.example.com/folder)
  2. Created a Test MCC account and a Production MCC account (token pending)
  3. Followed the instructions here: https://developers.google.com/adwords/api/docs/test-accounts and here https://www.youtube.com/watch?v=Idvia4600_E.
  4. Here is my code in this file (/googleads-php-lib-5.7.1/src/Google/Api/Ads/AdWords/auth.ini) : 

; Detailed descriptions of these properties can be found at:

developerToken = "DEV TOKEN FROM PRODUCTION MCC ACCOUNT"
userAgent = "DUMMY TEXT"

; Uncomment clientCustomerId to make requests against a single AdWords account,
; such as when you run the examples.
; If you don't set it here, you can set the client customer ID dynamically:
; $user = new AdWordsUser();
;  $user->SetClientCustomerId(...);

 clientCustomerId = "FROM MY TEST MCC ACCOUNT (FORMAT: XXX-XXX-XXXX)"

[OAUTH2]

; If you do not have a client ID or secret, please create one of type
; "installed application" in the Google API console:
client_id = "CLIENT ID FROM TEST MCC ACCOUNT, ENDING IN:.apps.googleusercontent.com (https://console.developers.google.com/ -> PROJECT ->APIS & AUTH -> CREDENTIALS -> NEW CLIENT ID -> WEB APP (REDIRECT URI -> HTTP://DEV.EXAMPLE.COM/oauth2callback))"
client_secret = "CLIENT SECRET FROM TEST MCC ACCOUNT"

; If you already have a refresh token, enter it below. Otherwise run
; GetRefreshToken.php.
refresh_token = "FOLLOWED INSTRUCTIONS HERE: https://developers.google.com/accounts/docs/OAuth2WebServer. USED THE CALLBACK AFTER 'CODE='"

I'm trying to get keyword search volume for a set of keywords and used these php scripts: /googleads-php-lib-5.7.1/examples/AdWords/v201409/Optimization/GetKeywordIdeas.php (tried all of the php scripts in the optimization folder) but there isn't anything in the output. Did I mess something up in the authentication?

Any help would be much appreciated.

Thanks!

- Ethan

Michael Cloonan (AdWords API Team)

unread,
Dec 29, 2014, 11:51:29 AM12/29/14
to adwor...@googlegroups.com
Hello Ethan,

I believe that the PHP examples have to be run from the command line. Please try running the basic example to get campaigns from the command line and see if that helps. If not, please send your unedited auth.ini file to me only by using the "reply to author" link.

Regards,
Mike, AdWords API Team
Reply all
Reply to author
Forward
0 new messages