Fotolia API throws "Invalid API Key" for no apparent reason. Then goes to work again without any changes.

86 views
Skip to first unread message

Picturefoods

unread,
Jan 19, 2012, 6:26:53 AM1/19/12
to Fotolia API
Hi there.

I'm running a Facebook app using the Fotolia API. I was getting an
"Invalid API Key" error for about three weeks in December. I contacted
the Fotolia helpdesk through Fotolia's website, they said nothing was
wrong with the API key and suddenly it worked again.
Now I'm getting the error *again* – I did *not* change anything about
the API key or the call. Could you please check for a possible
explanation?

Here's the actual app (using the old PHP XML RPC kit):
https://apps.facebook.com/picturefoods/

Here a test using the new REST API (throwing the same error):
http://www.picturefoods.com/fotolia/rest/

-------
Now it started working again, before I could even send this note...
(5 minutes later:) Now it's not working... (another 3 minutes:)
Working... (1 hour later:) Not working...
-------

Maybe there's a load problem on your servers? Or a problem with
Facebook / SSL connections? You might want to have an eye on this.


Best regards,
Oliver

halfer

unread,
Mar 9, 2012, 10:58:06 AM3/9/12
to fotol...@googlegroups.com

A belated reply, but hope it is still useful. Fotolia had around 20 mins downtime today, in which all API requests returned a 503 error. Unfortunately during this condition, the accompanying document is not XML but a HTML homepage, which will confuse any XML reader. In PHP this will result in a fatal error inside the Fotolia library, "Wrong parameters for Exception([string $exception [, long $code ]])".

Very rarely I will get the same error from the API during 'normal' uptime - which leads me to think that at times of high load, an HTML document is returned rather than an XML doc. Perhaps the best way to track this issue - since it is intermittent for you also - is to record all raw replies by hacking the library. Something like file_put_contents($logDir . '/' . time(), $response) on line 856 should do it. Then at least you can get some visibility on what is going wrong!

Best

Jon
Reply all
Reply to author
Forward
0 new messages