Forum Moderators: buckworks & skibum

Message Too Old, No Replies

Adwords APIlity

anybody using it?

         

JoaoJose

10:26 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Hi.

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?

your_store

10:30 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Sounds like it's not connecting to your account. I would double check your account information in authentication.ini.

JoaoJose

10:40 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Thks for your answer your_store.

Already checked it....

I even cleared everything on autentication.ini and the script returned the same error?!

I really don't know what's the problem....

SonNguyen

10:48 pm on Oct 2, 2005 (gmt 0)



Was just testing apility and I have the same error. Did you find any solution?

JoaoJose

11:49 pm on Oct 2, 2005 (gmt 0)

10+ Year Member



Not really...I've also asked about this on [groups.google.com...] and coulndn't get an answer...

StupidScript

10:20 pm on Oct 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Did you modify the data on line 496 of the lib/Campaign.php file? It looks like the <dummy> value of 0 might be failing ...? Maybe try a value of 1 ...?

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.

StupidScript

11:04 pm on Oct 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How many campaigns are you running?

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.

JoaoJose

11:28 pm on Oct 3, 2005 (gmt 0)

10+ Year Member



Hi StupidScript thks for your ideas. I'm running about 10 campaigns so that's not a problem. I'm going to check that script line :)

JoaoJose

11:41 pm on Oct 3, 2005 (gmt 0)

10+ Year Member



well, just tried changing the <dummie>0</dummie> line and it still doesn't work....

StupidScript

5:31 pm on Oct 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Go ahead and change it back to 0. Here's from the adwords-api-php Google group:

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 496

Array ( )

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 sets
 Email=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.

JoaoJose

4:41 pm on Oct 5, 2005 (gmt 0)

10+ Year Member



Hi StupidScript.

All my log in information is correct and I do have data on my client's account...

Thks for your help anyway. :)

StupidScript

5:19 pm on Oct 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What are you running this on (OS, server, PHP version, nuSOAP/SOAP version, OpenSSL version, cURL version)?

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.