I'm trying to use this new feature for the adwords API you can find it here [google-apility.sourceforge.net...]
but I'm not able to run the example script.
The error I get is
Warning: Invalid argument supplied for foreach() in XXXXX/apility_1.0.0c/lib/Campaign.php on line 496
Array ( )
Array ( )
Array ( )
Array ( )
I've already asked on the adwords api forum but I wasn't able to solve my problem.
Anybody having the same problem?
The <dummy> parameter is only included because: "This parameter is present because some SOAP toolkits have a hard time calling a function with headers but no parameters."
Have you tried leaving it out?
(In the current version, line 496 is a comment ... )
IMHO, the PHP examples have often been less than perfect, with various errors caused by an attempt to do something one way and the API doing it another. Sometimes you just have to start from scratch.
I ask, because I'm testing Apility on my Win98/Apache2/PHP4 setup with no problems.
I noticed during testing of the Keyword Service's Estimating Traffic demo that an Array was expected to be returned. If I tried to get the Estimated Traffic for only one keyword, it never worked.
Maybe you need to be running more than one campaign for the Apility demo to work.
This is one FAQ for APIlity's shipped sample project.php in case it only responds:Warning: Invalid argument supplied for foreach() in Campaign.php on line 496Array ( )Array ( )Array ( )Array ( )---
This very much looks like "incorrect" login information is given because all the information one gets about this account is that it is empty. This mostly happens when users have data in their manager's account but _NO_ data yet in their current client account.
If one sets
ClientEmail=f...@bar.com
in the authentication.ini, APIlity will try to get foo1's account data.
If one setsEmail=f...@bar.com
and leaves ClientEmail blank, APIlity will try to get foo2's account data.Email specifies the manager, ClientEmail the client of the specified manager. One can switch between all clients by:
$authenticationContext->setClientEmail("new...@bar.com");or even
$authenticationContext->setEmail("new...@bar.com");for switching one's manager account.
I'm seeing that the foreach() loop is looking for
$allCampaigns['getAllAdWordsCampaignsReturn'] as its only parameter. It must be an array, either a single-element array created by the previous if(isset condition or an array returned by the call to getAllCampaigns(). The above quote from the group seems to be saying that if the array is called, but is empty, it will throw the error you are seeing.
I ask because when I first started working with the API using PHP from my Red Hat 7.3 Linux box, I needed to have both cURL and OpenSSL installed, up to date and running before anything would authorize. The docs say "either" cURL or OpenSSL, but on a Linux box you need both.