5

We have an iCloud calendar PHP integration that uses batch CRUD methods as detailed here: https://github.com/apple/ccs-calendarserver/blob/master/doc/Extensions/calendarserver-bulk-change.txt

It appears Apple has updated their servers because since last week suddenly the integration stopped working. There were various changes we could fix, such as creating calendars and events. But <MM:delete/> does not work yet, even though I'm using the exact specs required.

Here's the body:

$body = <<<CALENDAR
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MM:multiput xmlns:D="DAV:"
           xmlns:MM="http://me.com/_namespace/"
           xmlns:C="urn:ietf:params:xml:ns:caldav">
       <MM:resource>
       <D:href>/12345678/calendars/calendarname/1234.ics</D:href>
       <MM:delete/>
   </MM:resource>
</MM:multiput>
CALENDAR;

The Guzzle request looks like this:

$response = $client->request('POST', 'https://pXX-caldav.icloud.com/{$iCloudUserId}/calendars/{$calendarName}/', [
       'auth' => [
           '[email protected]',
           'third-party-pass',
       ],
       'headers' => [
           'Content-Type' => 'application/xml; charset="utf-8',
       ],
       'body' => $body,
   ]);

The response I get is empty, it does not return 200 OK multiresponse like it did before. And nothing happens in iCloud either. It looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns2:multistatus 
      xmlns:ns6="http://me.com/_namespace/" 
      xmlns:ns5="http://calendarserver.org/ns/" 
      xmlns:ns2="DAV:" 
      xmlns:ns4="urn:ietf:params:xml:ns:caldav" 
      xmlns:ns3="http://apple.com/ns/ical/"
    />

The strange thing is, a regular DELETE for one event works. But then we would have to fire a lot of requests to the server.

How should I do a proper multiput delete for iCloud now?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.