Hey…
i was using a simple code to push ics files to a nextcloud calendar.
This worked good… i also was able to delete and reupload again… or just upload again and overwrite…
but since any update (i don’t know which), there seems to be a trashbin for deleted calendar events. and now, when i delete an event and after that i want to reupload it, i get a UID error…
Deleted calendar object with uid already exists in this calendar collection.
This - for sure - makes sense… but how to access those deleted calendar objects to undelete or delete from trashbin?
The “standard”-trashbin doesn’t seem to host those files… i can’t find them via this api:
https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/trashbin.html
Since i wasn’t able to find an API for accessing CalDAV-Trashbin, i tried to find all calendars… and i found a trashbin
-Calendar via:
curl -s -X PROPFIND https://USER:PASS@cloud/remote.php/dav/calendars/USER/
After digging deeper, i found:
/remote.php/dav/calendars/USER/trashbin/restore
/remote.php/dav/calendars/USER/trashbin/objects
Digging even deeper via
got me this to have all events in trashbin parsed:
curl -s -X REPORT https://USER:PASS@cloud/remote.php/dav/calendars/USER/trashbin/objects --upload-file - -H "Depth: 1" <<end
<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
<d:prop>
<d:getetag />
<c:calendar-data />
</d:prop>
<c:filter>
<c:comp-filter name="VCALENDAR" />
</c:filter>
</c:calendar-query>
end
but thats not realy what i wanted… i don’t want to display all the ICS data… i want to get the correct file…
so i tried to filter like this…
curl -s -X REPORT https://USER:PASS@cloud/remote.php/dav/calendars/USER/trashbin/objects --upload-file - -H "Depth: 1" <<end
<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
<d:prop>
<d:getetag />
<c:calendar-data />
</d:prop>
<c:filter>
<c:comp-filter name="VCALENDAR">
<c:comp-filter name="VEVENT">
<c:prop-filter name="UID">
<c:text-match collation="i;octet">my-uid</c:text-match>
</c:prop-filter>
</c:comp-filter>
</c:comp-filter>
</c:filter>
</c:calendar-query>
end
but this filter is not working…
well… downloading the complete data… and parsing + filtering localy is slow as hell…
whats a good solution to undelete or delete from trashbin?
And is there any kind of API Documentation?