Home » Kerio User Forums » Kerio Connect » Communication with Kerio caldav interface results in 501 responses

Messages: 25
Karma: -1
Send a private message to this user
I would really love to talk to the caldav server of Kerio via php from another server. So far I had no luck at all. I made a script from a couple of links that I found scattered around this forum and the rest of the internet. Most of it is a copy of http://trentrichardson.com/2012/06/22/put-caldav-events-to-c alendar-in-php/
But I have no idea how much of that is actually still supposed to work and I couldn't find anymore documentation about something like this.
So pointing me to the right documents would also be very much appreciated, thanks!

This php script results in
* upload completely sent off: 233 out of 233 bytes
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 501 Not Implemented
< Connection: Close
< Content-Type: text/html
< Date: Fri, 7 Aug 2015 10:40:09 GMT
< Server: Kerio Connect 8.5.1
< X-UA-Compatible: IE=edge
* nread <= 0, server closed connection, bailing
* Closing connection #0

$account['uri'] = "";
$account['user'] = "tim";
$account['pass'] = "changedpassword";

$uid = "test-12345"; // setting this to an existing uid updates event, a new uid adds event
$url = $account['uri'].'/'.$uid.'.ics'; 
$userpwd = $account['user'] .":". $account['pass'];
$description = 'My event description here';
$summary = 'My event title 1';
$tstart = '201508015T000000Z';
$tend = '20150816T000000Z';
$tstamp = gmdate("Ymd\THis\Z");

$body = <<<__EOD

$headers = array(
    'Content-Type: text/calendar; charset=utf-8',
    'If-None-Match: *',
    'Expect: ',
    'Content-Length: '.strlen($body),

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_USERPWD, $userpwd);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$ret = curl_exec($ch);
$error = curl_error($ch);
var_dump($ret, $error);exit;

Any idea why I get the 501 response for this? What am I missing?
Pavel Dobry (Kerio)

Messages: 2057
Karma: 251
Send a private message to this user
URL /caldav/users/changeddomain.com/tim should be used for getting calendar resources from the server. For putting new events to the calendar you must use URL for that calendar (as returned in request for /caldav URL when listing resources).

Messages: 25
Karma: -1
Send a private message to this user
So I need to request the calendar resources first, look into the data and find a URL in there which then can be used to add new events to a calendar? Did I understand that correct?

Thanks very much for help!

[Updated on: Mon, 10 August 2015 11:09]

Previous Topic: Outlook Internet calendar and Kerio Connect
Next Topic: Error 28110 with Windows 10 and Outlook 2013 and Kerio 8.5.1
Goto Forum:

Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Wed Jan 16 06:59:57 CET 2019

Total time taken to generate the page: 0.77520 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.