API issues - PHP

24 views
Skip to first unread message

ejay.o...@momentummedia.com.au

unread,
Aug 24, 2017, 9:05:14 PM8/24/17
to AdWords API Forum
Hi Adwords API Team

As i upload the adwords application in my live web application. Some of the syntax are now working

NOTE: the whole adwords application is working in my localhost.

Upon Testing in my live web, i tested the sample GetCampaigns to check if the migration of files is successful and it didn't work. 
However, I checked $oAuth2Credential and $session and it gave me a perfect result. so i guess that the migration of files from my localhost to live web is successful

It seems that i'm encountering error in this line:

$campaignService = $adWordsServices->get($session, CampaignService::class);

Thanks,

Ejay

Vincent Racaza (AdWords API Team)

unread,
Aug 24, 2017, 11:45:42 PM8/24/17
to AdWords API Forum
Hi Ejay,

All our PHP client library examples are meant to be run via command line, and not through a web page. This is specified in the "Basic usage" section of this document. However, you may use the same code flow/logic from one of the code examples into your web application. In addition, here's the API Call Structure guide for reference on building your request.  

Kindly make sure that you follow the guide on building your request in a web application so you won't encounter any errors.

Thanks,
Vincent
AdWords API Team

ejay.o...@momentummedia.com.au

unread,
Aug 25, 2017, 1:37:42 AM8/25/17
to AdWords API Forum
Hi Vincent,

Yes I used the flow/logic based on what structure of codes you have in the code examples and it worked fine here in my localhost. 
So does this mean that the only way for me to send request in my web application is through curl?

Thanks,

Ejay

Vincent Racaza (AdWords API Team)

unread,
Aug 25, 2017, 2:34:20 AM8/25/17
to AdWords API Forum
Hi Ejay,

For now, using cURL or wget would be the recommended approach if you won't be using one of our client libraries. Or in your condition, since you will be running your requests in a web application, and not in command line. You need to do this as our examples in PHP are not meant to be run in a webpage.

Also, since this concern is more specific to the PHP client library, I would suggest that you post here so that the library owners can also provide suggestions on how to achieve your specific use-case.
Reply all
Reply to author
Forward
0 new messages