Google API Adwords PHP

222 views
Skip to first unread message

Nick Mulder

unread,
Mar 15, 2016, 9:01:34 AM3/15/16
to AdWords API Forum

Hi everyone,

I'm new with Google Adwords API PHP and I'm trying to connect the API on my XAMPP server (localhost).
I did some research, but I can't find the correct answer yet. 

First I downloaded the Adwords API PHP Library from Github and placed it in my htdocs in the XAMPP folder. 

The directory I use: xampp\htdocs\adwords api\src\Google\Api\Ads\AdWords

I searched for my developers token in my MCC account in Adwords and placed it in the auth.ini file. 
Same for the client_id and client_secret. For this I made a project on console.google.com, to get access to a client id and secret (installed application). 

Everything is looking good and I managed to run the GetRefreshToken.php and get the token. I also filled this one in (in my auth.ini file). 
Now, I want to try running an example from the API. When I run the GetCampaigns.php in the command prompt, I get this error: 


PHP Notice:  Use of undefined constant WSDL_CACHE_NONE - assumed 'WSDL_CACHE_NONE' in C:\xampp\htdocs\adwords api\src\Google\Api\Ads\Common\Lib\AdsUser.php on line 225
Notice: Use of undefined constant WSDL_CACHE_NONE - assumed 'WSDL_CACHE_NONE' in C:\xampp\htdocs\adwords api\src\Google\Api\Ads\Common\Lib\AdsUser.php on line 225
 
An error has occurred: Validation failed for [userAgent] with value []: The property userAgent is required and cannot be null, the empty string, or the default [INSERT_COMPANY_NAME_HERE]

Can someone help me out?

Thanks! 


Nick. 

Yin Niu

unread,
Mar 15, 2016, 10:02:37 AM3/15/16
to AdWords API Forum
Hi Nick, 

You need to add User Agent value in auth.ini file. 

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