Results 1 to 3 of 3

Thread: Zimbra SOAP API request appointments for a calendar including repeat time interval

  1. #1
    Join Date
    Jun 2013
    Rep Power

    Default Zimbra SOAP API request appointments for a calendar including repeat time interval

    I have Googled extensively and tried mining the Zimbra webmail front end for requests and responses to the Zimbra SOAP API but I can't find how to do the following:
    - request all appointments for a calendar using XML (the request below is in JSON and returns XML, would be nice to be able to make the request in XML)
    - for repeating appointments, obtain the repeating time interval

    Below is an example of how it is done with JSON request (except that the JSON response does not appear to include the repeating time interval for repeating appointments).
    The request below requests all appointments (between 1/1/1970 and 1/1/2114 = Unix dates 0 to 4544208000000 in MSEC) for the Calendar with ID=10.
    The response (in XML) has 2 appointments, the first is a single appointment, the second is a daily repeating appointment but none of the properties seem to indicate the repeating time interval.

    Request URL:


    { "Body" : { "BatchRequest" : { "SearchRequest" : { "_jsns" : "urn:zimbraMail",
    "calExpandInstEnd" : 4544208000000,
    "calExpandInstStart" : 0,
    "limit" : "500",
    "locale" : { "_content" : "en_AU" },
    "offset" : 0,
    "query" : { "_content" : "inid:10" },
    "sortBy" : "none",
    "types" : "appointment"
    "_jsns" : "urn:zimbra",
    "onerror" : "continue"
    } },
    "Header" : { "context" : { "_jsns" : "urn:zimbra",
    "account" : { "_content" : "",
    "by" : "name"
    "authToken" : "A_valid_authToken_goes_here",
    "format" : { "type" : "xml" },
    "sessionId" : { "_content" : 14630204,
    "id" : 14630204
    "userAgent" : { "name" : "ZimbraWebClient",
    "version" : "5.0"
    } }

    Response (content of <BatchResponse> only shown):

    <BatchResponse xmlns="urn:zimbra">
    <SearchResponse xmlns="urn:zimbraMail" more="0" sortBy="none" offset="0">
    <appt alarm="1" loc="In the office" transp="O" fb="B" id="327" rev="804" isOrg="1" fba="B" score="1.0" t="" compNum="0" name="Subject for a single appointment" s="0" d="1375942257000" ms="900" md="1376003780" class="PUB" uid="e21505b9-c64a-42e0-abe6-07010f44f458" ptst="AC" status="CONF" cm="1" l="10" dur="3600000" sf="" f="" x_uid="e21505b9-c64a-42e0-abe6-07010f44f458" invId="327-326">
    <or d="Joe Bloggs" a="" url="" />
    <fr>These are notes for my single appointment</fr>
    <appt alarm="1" loc="On the beach" transp="O" fb="B" recur="1" id="338" rev="811" isOrg="1" fba="B" score="1.0" t="" compNum="0" name="Subject for a daily repeating appointment" s="0" d="1375944660000" ms="1004" md="1376011270" class="PUB" uid="921dc981-c9a6-4f11-9617-ccad3328c144" ptst="AC" cm="1" status="CONF" l="10" dur="3600000" sf="" f="" x_uid="921dc981-c9a6-4f11-9617-ccad3328c144" invId="338-337">
    <or d="Joe Bloggs" a="" url="" />
    <fr>These are notes for my repeating appointment</fr>

  2. #2
    Join Date
    Jun 2013
    Rep Power


    The answer to the sub-question above (how to make the JSON request as an XML SOAP call) is shown here. This gives the same response as shown above.

    <soap:Envelope xmlns:soap="">
    <context xmlns="urn:zimbra">
    <userAgent name="ZimbraWebClient" version="1.0" />
    <account by="name"></account>
    <format type="xml" />
    <BatchRequest xmlns="urn:zimbra" onerror="stop">
    <SearchRequest xmlns="urn:zimbraMail" types="appointment" calExpandInstStar="0" calExpandInstEnd="4544208000000">

    However, the main question, remains - how does one obtain information defining the recurrence of a recurring appointment?

    The soap-calendar.txt document of the Zimbra documentation defines the following...

    // GetRecur
    // Retrieve the recurrence definition of an appointment
    <GetRecurRequest id="calendar item id"/>

    [same as ExpandRecurRequest content]

    However I could not get the above to work, I tried the following...

    <BatchRequest xmlns="urn:zimbra" onerror="stop">
    <GetRecurRequest xmlns="urn:zimbraMail" id="921dc981-c9a6-4f11-9617-ccad3328c144"/>

    ...where the id used is the uid of the repeating appointment in the response above. However, this returns an INVALID_REQUEST SOAP fault. Is the namespace wrong within the GetRecurRequest tag above or is something else incorrect?

  3. #3
    Join Date
    Mar 2006
    Greenwood, IN
    Rep Power


    Hi Simon,

    Have a look at Zimbra SOAP API Reference 8.0.4_GA_5737 and test with zmsoap. Use the id attribute from SearchResponse in your request as it correlates to database field.

    zmsoap -v -z -m user@domain.tld GetRecurRequest @id=2263992
    <GetRecurRequest id="2263992" xmlns="urn:zimbraMail"/>
    <GetRecurResponse xmlns="urn:zimbraMail">
      <tz id="America/Chicago" stdoff="-360" stdname="CST" dayoff="-300" dayname="CDT">
        <standard wkday="1" min="0" sec="0" mon="11" hour="2" week="1"/>
        <daylight wkday="1" min="0" sec="0" mon="3" hour="2" week="2"/>
        <s u="1375117200000" d="20130729T120000" tz="America/Chicago"/>
        <e u="1375120800000" d="20130729T130000" tz="America/Chicago"/>
            <rule freq="WEE">
              <interval ival="1"/>
                <wkday day="MO"/>
        <exceptId d="20130902T120000" tz="America/Chicago"/>
    Jason Bryan
    Zimbra R&D

Similar Threads

  1. Load all appointments including all attendees for user
    By Nicole Plattner in forum Developers
    Replies: 0
    Last Post: 06-10-2013, 08:08 AM
  2. Calendar appointments change time by one hour
    By Laird in forum Administrators
    Replies: 6
    Last Post: 10-28-2011, 12:38 AM
  3. Calendar appointments change time by one hour after DST
    By nglacet in forum Administrators
    Replies: 0
    Last Post: 10-07-2011, 09:24 AM
  4. Replies: 0
    Last Post: 02-07-2011, 04:40 PM
  5. Repeat calendar appointments failing.
    By dhallweb in forum Administrators
    Replies: 2
    Last Post: 04-12-2006, 11:33 AM

Tags for this Thread

Posting Permissions

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