How to connect to Kerio programatically? [closed]

6 days ago 6
ARTICLE AD BOX

I'm trying to interact with Kerio mail server in an attempt to programatically add events to a user's calendar. However, I'm not even able to connect. I tried the JSON API first, then the PHP API, thinking that might be easier. I haven't gotten either to work. The documentation is very sparse, and seems to be from around 2012. I haven't found anything newer.

When trying simply to log in with the PHP API, I get:

Fatal error: Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, string given in /Applications/MAMP/htdocs/keriotest/kerio-api-php/src/class/KerioApiSocket.php:145 Stack trace: #0 /Applications/MAMP/htdocs/keriotest/kerio-api-php/src/class/KerioApiSocket.php(145): fclose('') #1 /Applications/MAMP/htdocs/keriotest/kerio-api-php/src/class/KerioApiSocket.php(117): KerioApiSocket->close() #2 /Applications/MAMP/htdocs/keriotest/kerio-api-php/src/class/KerioApi.php(512): KerioApiSocket->__destruct() #3 /Applications/MAMP/htdocs/keriotest/kerio-api-php/src/class/KerioApi.php(477): KerioApi->send('POST', '{"jsonrpc":"2.0...') #4 /Applications/MAMP/htdocs/keriotest/kerio-api-php/src/class/KerioApi.php(320): KerioApi->sendRequest('Session.logout') #5 /Applications/MAMP/htdocs/keriotest/index.php(21): KerioApi->logout() #6 {main} thrown in /Applications/MAMP/htdocs/keriotest/kerio-api-php/src/class/KerioApiSocket.php on line 145

I'm guessing this means the API hasn't been updated in the last 14 years, and simply doesn't work anymore.

Is anyone still able to connect to the latest Kerio, either by curl/JSON or PHP?

Read Entire Article