Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-2007, 12:20 PM
Active Member
 
Posts: 31
Default Updating Calendar Entries with REST

I'm trying to help my users by making programmatic modifications to some of their calendar entries. I've read all the available blog and docs on updating items using REST, but my updates don't appear to do anything. Also, there's an appalling lack of usable examples of sending actual files.

I'm using the recommended posting command line:

Quote:
curl -u 'myuserassword' \
--data-binary '@./test.ics' \
'https://server.example.com/service/home/myuser/calendar?fmt=ics'
I have an ics file that looks like this:
Quote:
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
ORGANIZER:MAILTO:bevan@example.com
UID:f0359778-ce86-4dd0-aaeb-11e7a5308ba9
SUMMARY:Iron Mountain Intro
DESCRIPTION:The following is a new meeting request
DTSTART;TZID="(GMT-08.00) Pacific Time (US & Canada)":20070927T100000
DTEND;TZID="(GMT-08.00) Pacific Time (US & Canada)":20070927T110000
LOCATION:Pasadena Boardroom
STATUS:CONFIRMED
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
TRANSP:OPAQUE
ATTENDEE;CN=Pasadena Boardroom;CUTYPE=RESOURCE;ROLE=NON-PARTICIPANT;PARTSTAT
=NEEDS-ACTION;RSVP=TRUE:MAILTOasadena@example.com
DTSTAMP:20070918T182540Z
SEQUENCE:0
END:VEVENT
END:VCALENDAR
I then try changing something in the file, like the summary or start time. The curl completes with no errors (if I remove the BEGIN:VCALENDAR I do get an error back) but the entry never gets updated.

Has anyone gotten this sort of thing to work properly and update an existing entry?
Reply With Quote
  #2 (permalink)  
Old 10-11-2007, 01:57 PM
Active Member
 
Posts: 31
Default Bump

Anyone? Bueller?

Does anyone else have any tips for updating existing calendar entries rather than just adding new entries?

It seems like it should be possible, and it would be -really- useful.

Do I have to switch to doing some funky SOAP thing instead?
Anyone have at least a working example???
Reply With Quote
  #3 (permalink)  
Old 10-11-2007, 02:28 PM
Zimlet Guru & Moderator
 
Posts: 467
Default

Quote:
Originally Posted by Bevan Bennett View Post
Anyone? Bueller?

Does anyone else have any tips for updating existing calendar entries rather than just adding new entries?

It seems like it should be possible, and it would be -really- useful.

Do I have to switch to doing some funky SOAP thing instead?
Anyone have at least a working example???
My suspicion is that only a GET on a ICS file that is subscribed will work. Take a look at the Java Zclient classes. You should be able to pull the message and replace the ICS file, though I have never tried it.
Reply With Quote
  #4 (permalink)  
Old 10-11-2007, 04:30 PM
Active Member
 
Posts: 31
Default

Quote:
My suspicion is that only a GET on a ICS file that is subscribed will work.
I can GET files just fine. I can also POST an ics for a new appointment.
What I can't do is POST an ics file to modify an existing appointment.
I suspect that may be because REST "just doesn't do that", but there still must be -some- option.

Quote:
Take a look at the Java Zclient classes.
Where would these be?

I'm also going to try using a debugger to capture what my browser sends out when I use it to edit an appointment.
Reply With Quote
  #5 (permalink)  
Old 10-12-2007, 08:46 AM
Zimbra Employee
 
Posts: 1,434
Default

First, are you seeing anything in your server logfiles? That's usually the first place to look when data import doesn't behave as you'd expect.

Second (and please note that I Am Not The Calendar Guy), does it work if you put METHOD:REQUEST as the second line of the content?
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #6 (permalink)  
Old 10-12-2007, 09:46 AM
Active Member
 
Posts: 31
Default Solved!!!

I was seeing nothing in the server logs, but I have now solved the mystery!!!

The keys to updating a calendar entry with REST are as follows:

1) Include a DTSTAMP value HIGHER than the one in the database (the current time would be good). This was my main problem, since the server quietly discarded all the "obsolete" versions that I sent it.

2) Keep everything else the same, as the entry will be replaced in it's entirety with the new values (so any element you remove from your ics will be removed from the entry).

3) If using the admin login, use the admin URL. If using a user's login, use the regular URL.

Hooray! Now I can go programmatically fix some entries for a user!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.