I have a php script connecting to opencalais api
but sometimes it works, somtimes it shows me errors. Everytime i refrech browser (one time i get good result without errors, another time i got errors) This is so strange.
the code is about sending string content from "string array" (containing few words) to opencalais
and i will juste get topics of each word in array. Just that, it's very strange
As you may expect, given the same input (identical), Calais' output should be the same.
If you can a run a simple test by repeating the same request with same input we may be able to investigate further (see that maybe some of the requests timeout). In addition, if you can review your HTTP request log (F12->network tab) you may see the actual errors returned from Calais which I hope amount to timeout in which case you will have to implement retries if you must have a response or skip if the response is not crucial.
At any rate, given the error message above a "null check" on the array will help you avoid this error.
As you justly expect seems like an easy task indeed...
So Let's try to figure out what is going wrong here:
Please verify that you are providing the authentication Calais token and the rest of the header parameters as you can see from the API documentation and also from an earlier question in this forum.
At any rate, please provide 1 and 2 and we will try to resolve your issue ASAP.
Thanks, here are my 2 files in attachement:fcontext.zip
Everytime i refrech browser page, i get one of those 2 results (same script of course)
or just this result without error:
Array (  => Politics )