Results 1 to 4 of 4

Thread: Retreiving free/busy data for a given timeframe

  1. #1
    synack is offline New Member
    Join Date
    Mar 2007
    Posts
    3
    Rep Power
    8

    Default Retreiving free/busy data for a given timeframe

    I'm working on an application that uses Zimbra's freebusy.ifb service to retrieve a list of times that should be blocked out. However, by default this only returns events which occur today. I need to retrieve the free/busy data for a given number of days (roughly a week).

    I spent a few minutes digging around the Zimbra source code and found that the time-range value may be passed in as a GET variable, but I am unsure of how to format the value. As far as I can tell, it wants a date range specified by two ISO8601 date/time strings but I don't know how to delimit them or what order to place them in the string.

    So far, I've figured this much out:

    Code:
    http://zimbra.example.com/service/pubcal/freebusy.ifb?acct=foo@example.com&time-range=<date>
    I need an example of proper formatting of the time-range dates. Thanks in advance.

    --
    Jeremy Grosser
    Developer
    poky.com
    jeremy@poky.com

  2. #2
    bobby is offline Zimbra Employee
    Join Date
    Nov 2005
    Posts
    518
    Rep Power
    10

    Default

    actually it looks like it wants unix time (note that it's *milliseconds* instead of seconds):

    from PublicICalServlet.java:
    Code:
            long now = new Date().getTime();
    from java.util Class Date:

    getTime()
    Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
    and it looks like the parameters you want for the request are "s" and "e" (for start and end):

    Code:
            String acctName = req.getParameter("acct");
            String startStr = req.getParameter("s");
            String endStr = req.getParameter("e");
    Last edited by bobby; 03-26-2007 at 03:15 PM.

  3. #3
    synack is offline New Member
    Join Date
    Mar 2007
    Posts
    3
    Rep Power
    8

    Default

    's' and 'e' appear to be the correct variable names, but I don't think it's parsing the date correctly. I send the current unix timestamp returned by mktime() as 's' and add (86400 * days) to get the value of 'e'. However, when Zimbra's response comes back, the DTSTART and DTEND values are at the beginning of the epoch (January 1, 1970).

    This leads me to believe that I'm still sending the date incorrectly. I tried sending it in ISO8601 format and all I get back are some rather nasty looking Java errors so I think we're on the right track trying to send a unix time integer.

  4. #4
    synack is offline New Member
    Join Date
    Mar 2007
    Posts
    3
    Rep Power
    8

    Default

    As soon as I pushed that last post, I found the problem. According to your previous post, Java expects the timestamp to be in milliseconds, not seconds. Thanks for the help. Everything appears to be working now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change the volumes of Zimbra's data
    By Nico in forum Administrators
    Replies: 4
    Last Post: 11-07-2008, 02:54 PM
  2. Replies: 3
    Last Post: 07-19-2007, 02:00 AM
  3. [SOLVED] After reset of sync data, no longer able to sync
    By rojs in forum CalDAV / CardDAV / iSync
    Replies: 10
    Last Post: 06-14-2007, 04:30 PM
  4. Outlook Connector fails retrieving free/busy data
    By Nutz in forum Zimbra Connector for Outlook
    Replies: 2
    Last Post: 03-07-2007, 08:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •