Understanding, exploring, using freebusy directory API

Best practice information from Scalix users relating to integration of Scalix with other products.

Moderator: ScalixSupport

jaime.pinto
Scalix Star
Scalix Star
Posts: 709
Joined: Fri Feb 23, 2007 6:50 pm
Location: Toronto - Canada

Understanding, exploring, using freebusy directory API

Postby jaime.pinto » Wed Oct 29, 2008 10:08 am

Hey guys

We are trying to do some internal development and rely on the scalix api to get FREEBUSYinformation. Initially we're doing things in the wrong way, relying on the caldav format, and therefore could not get anywhere. Now we found the proper way, and I wanted to post this here in case other people need:

Yesterday after the 11.4.2 upgrade, the caldev access seems to be working much better. So I sent a sample of what I can get from my account to one of our developers

https://mail.domain.com/api/dav/Calenda ... 891d64.ics

BEGIN:VCALENDAR

CALSCALE:GREGORIAN
PRODID:-//Scalix Corporation//Scalix Server 11.4.2.12068//EN VERSION:2.0 METHOD:PUBLISH BEGIN:VEVENT
UID:
040000008200E00074C5B7101A82E00800000000F04438ED2005C901000000000000000010
000000CC60CA2CA4E7BB4A913CEE243FA65EFD
DTSTAMP:20080823T170533Z
DTSTART;VALUE=DATE:20081219
DTEND;VALUE=DATE:20090121
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-CDO-IMPORTANCE:1
PRIORITY:5
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:OOF
SEQUENCE:0
SUMMARY:VACATION
X-SCALIX-LABEL:1
LOCATION:BRAZIL
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR


Here is what he responded:

Hey Jaime,

That's pretty darn neat! Unfortunately, (sorry to say this :-( ) it seems a bit different from what I need. In essence, what the FREEBUSY service would (hopefully) do is to save us from iterating through ALL of the calendar items of a user and getting what times are taken and if the time is busy/etc (essentially implementing our own FREEBUSY service!), it would actually retrieve that for us, and put it into a nice little file. The following is what I took from the API (I've perused it many times, and have dreamed of this happening but...no such luck):

The freebusy service allows you to:
• Query other people’s (and your own) free/busy schedule. It returns data formatted as iCal data (GET) • Update your own free/busy data (POST) *Example — The URL for the free/busy data for user Max.Mustermann@Company.com is:
http://hobbit/api/Max.Mustermann@Company.com/freebusy*
Access to that URL is always authenticated and the principal e-mail address in the URL is of the person whose free/busy data you want to access. You can request your own data.
Example — Returned data *(This is what I'm looking for):

THIS EXAMPLE IS ON THE 11.3 API GUIDE, PAGE 17

* BEGIN:VCALENDAR BEGIN:VFREEBUSY
ATTENDEE:MAILTO:Max.Mustermann@Company.com
DTSTART:20060531T070000Z
DTEND:20060801T070000Z
FREEBUSY;FBTYPE=BUSYUNAVAILABLE:20060531T070000Z/20060601T070000Z
FREEBUSY;FBTYPE=BUSYTENTATIVE:20060606T170000Z/20060606T180000Z
FREEBUSY;FBTYPE=BUSY:20060612T153000Z/20060612T160000Z
FREEBUSY;FBTYPE=BUSY:20060613T150000Z/20060613T153000Z
FREEBUSY;FBTYPE=BUSYTENTATIVE:20060613T170000Z/20060613T180000Z
FREEBUSY;FBTYPE=BUSY:20060613T180000Z/20060613T200000Z
FREEBUSY;FBTYPE=BUSY:20060613T204500Z/20060613T213000Z
FREEBUSY;FBTYPE=BUSYUNAVAILABLE:20060614T070000Z/20060615T070000Z
FREEBUSY;FBTYPE=BUSY:20060614T150000Z/20060614T160000Z
FREEBUSY;FBTYPE=BUSY:20060615T023000Z/20060615T060000Z
FREEBUSY;FBTYPE=BUSYUNAVAILABLE:20060615T150000Z/20060615T160000Z
FREEBUSY;FBTYPE=BUSY:20060615T160000Z/20060615T180000Z
FREEBUSY;FBTYPE=BUSY:20060615T201500Z/20060615T210000Z
FREEBUSY;FBTYPE=BUSY:20060616T180000Z/20060616T193000Z
FREEBUSY;FBTYPE=BUSYTENTATIVE:20060620T170000Z/20060620T180000Z
FREEBUSY;FBTYPE=BUSYUNAVAILABLE:20060621T070000Z/20060622T070000Z
FREEBUSY;FBTYPE=BUSY:20060623T020000Z/20060623T043000Z
FREEBUSY;FBTYPE=BUSY:20060624T213000Z/20060625T033000Z
FREEBUSY;FBTYPE=BUSYTENTATIVE:20060627T170000Z/20060627T180000Z
FREEBUSY;FBTYPE=BUSYUNAVAILABLE:20060628T070000Z/20060629T070000Z
FREEBUSY;FBTYPE=BUSY:20060630T020000Z/20060630T043000Z
END:VFREEBUSY


In addition I used the following command from a shell on the server:

[root@mail ~]# sxshowfb --user jaime

FreeBusy Version : 0001

Publish Start : Tue Sep 30 20:00:00 2008
Publish End : Sun Nov 30 19:00:00 2008

Fri Oct 24 11:30:00 2008 - Fri Oct 24 12:30:00 2008 Flag=Busy
Tue Oct 28 07:00:00 2008 - Tue Oct 28 08:00:00 2008 Flag=Busy

Thu Oct 30 06:00:00 2008 - Thu Oct 30 07:00:00 2008 Flag=Busy
Thu Oct 30 09:00:00 2008 - Thu Oct 30 10:00:00 2008 Flag=Busy
Thu Oct 30 10:00:00 2008 - Thu Oct 30 12:00:00 2008 Flag=Busy
Fri Oct 31 11:00:00 2008 - Fri Oct 31 13:00:00 2008 Flag=Busy
Fri Oct 31 14:30:00 2008 - Fri Oct 31 18:00:00 2008 Flag=Busy


Obviously not the same format as our developer expects either.
So I tried

https://mail.domain.com/api/jaime@domain.com/freebusy , and guess what !!!

BEGIN:VCALENDAR
BEGIN:VFREEBUSY
ATTENDEE:mailto:jaime@domain.com
DTSTART:20081001T000000Z
DTEND:20081201T000000Z
FREEBUSY;FBTYPE=BUSY:20081024T153000Z/20081024T163000Z
FREEBUSY;FBTYPE=BUSY:20081028T110000Z/20081028T120000Z
FREEBUSY;FBTYPE=BUSY:20081030T100000Z/20081030T110000Z
FREEBUSY;FBTYPE=BUSY:20081030T130000Z/20081030T140000Z
FREEBUSY;FBTYPE=BUSY:20081030T150000Z/20081030T160000Z
FREEBUSY;FBTYPE=BUSY:20081031T150000Z/20081031T170000Z
FREEBUSY;FBTYPE=BUSY:20081031T183000Z/20081031T220000Z
END:VFREEBUSY
END:VCALENDAR


Just like the guide says. So it pays to take the time and read the documentation

Here is the caveat: USER NEEDS TO BE A PREMIUM ACCOUNT, otherwise the system will return a "could not get freebusy data"
Image Jaime
||||||||||||||||||||||||||||||||||||||||

Return to “Third Party Integration”



Who is online

Users browsing this forum: No registered users and 2 guests