Hello Kent,
Just starting playing with some API using PHP and started with the JSON (not legacy) examples. I am currently running a version 7.
It seems like when the poker server has not been started then the "503 Service Unavailable" string is returned from curl_exec().
In the example API.php this falls through the tests for a curl error and empty() response tests and proceeds to json_decode() which populates the resultant object properties with NULL, and so the resultant page values are empty, and as well errors from the php code trying to access the NULL properties are being logged to the web server (in my case IIS so logged to the file setup as log for the fastcgi handler).
I am thinking that rather than display empty fields my end user, i will add some further checks and piggy back on the example ERROR array result and the error message and die handling in the example callers of the API.php. If i wanted to try to tighten this up by dealing with the poker server not running, then is there some way to start up the poker server through automation?
API.php and 503 response
-
- Site Admin
- Posts: 5937
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API.php and 503 response
That is correct, the API connection is only live when the client connections are live.segmentlime wrote: ↑Tue Jul 16, 2024 7:21 pm Just starting playing with some API using PHP and started with the JSON (not legacy) examples. I am currently running a version 7.
You would have to automate the reboot of Windows. If this setting is enabled:If i wanted to try to tighten this up by dealing with the poker server not running, then is there some way to start up the poker server through automation?
System tab -> Server Settings -> Auto start server at bootup
then both client and API connections will go live automatically.