REST File Formats

Revision as of 21:44, 16 February 2017 by Jorge de la Cruz (talk | contribs) (→‎ATOM)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

REST File Formats

   KB 2839        Last updated on 2017-02-16  

(0 votes)

Format Types

We are supporting a number of different "formats" for returned data. The formats we currently have implemented are:

REST file formats
Format Description
atom For generating an ATOM feed of mail messages and calendar appts.
csv For exporting contacts.
ics For exporting calendar appointments. See RFC 2445.
ifb Calendar free/busy data. See RFC 2445.
native Default formatter used to output messages and attachments in their "native" format. Used by the web client to reference attachments for downloading.
rss For generating an RSS feed of mail messages and calendar appts.
sync Similar to the native formatter, used by sync clients to retrieve raw message data, along with some extra meta-data in the HTTP header (tags, flags, received date).
vcf For exporting vcard files (vcard 3.0)
zip For exporting a set of messages (folder or search result) as a ZIP file.

Time Range Specifications

The time range can be specified in a number of different formats:

  • (milliseconds UTC)
  • {relative dates}

relative dates are either in the future (p/+/{not-specified}) or the past (m/-), along with a numeric value, followed by the units.

For units, everything after the first character is ignored (except for the "mi" case):

  • m(onths)
  • mi(nutes)
  • d(ays)
  • w(eeks)
  • h(ours)
  • y(ears)
1day 1 day from now
+2days 2 days from now
p1day 1 day from now
-2days 2 days ago
+60mi 60 minutes from now
+1week 1 week from now
+6mon 6 months from now
1year 1 year from now

The start/end query parameters apply to the atom, ics, rss, and ifb formatters.

Format Examples



Returns an Atom feed for all messages in the inbox. If you only want unread messages as part of the feed, you could include a search query:


You can also request an Atom feed of a calendar folder as well:


Note that "calendar" is the pathname to the folder called "calendar", it isn't a special-cased pathname. If you had a calendar folder called "talks", then you can access that folder via:


When used with a calendar folder, the Atom feed will (by default) generate a feed of all appointments -/+ 7 days from the current time. To specify a different time range, you can use the start/end query parameters:




Exports all contacts in the contacts folder. If you want to export only contacts tagged "zimbra", you can specify a query:


This will only export contacts that are tagged with "zimbra".



Will export all appointments in the calendar folder in the ICS format, suitable for import into a calendar client such as Apple's iCal, or Mozilla's Sunbird calendar client.





Either format will return free/busy data for all calendars that are configured to be included in free/busy data for the next 60 days.


The native formatter is used to request raw RFC 822 messages (for example, to implement "show original") or to down an attachment. For example, lets assume that message id 376 in my inbox is a multipart/mixed MIME message, and part 2 is an image.

The following URL (which is normally generated automatically when you are viewing your mail and click on an attachment), would download that attachment and display it in your browser:


Lets say part 3 in that same message is a word doc, you could display that via:


Finally, lets say you have the Network edition installed and want to view that same word doc as HTML instead of downloading the word doc and opening it up as an attachment. Adding "view=html" to the end of the URL will convert the word doc to HTML:


An upcoming release will expose this functionality directly in the web UI.



Returns an RSS feed for all messages in the inbox. All the other examples given for the Atom formatter also apply to the RSS formatter.

One further note on both the Atom and RSS formatters is that the calendar feeds provided by them currently only include the title/notes data. As soon as a more complete server-side I18N infrastructure is in place (we have been focused on the web client) the Atom/RSS feeds for calendars will be much more detailed.


The sync formatter is similar to the native formatter, with the only exception being it adds some extra meta-data to the output for sync clients.


The "vcf" formatter can export your contacts as series of vcards (vCard 3.0), or can be used to export a single contact as a vCard (to be used by the web client in a future version).

To get all your contacts as a series of vCard entries, specify "vcf" as the formatter on the GET url:



The Zip formatter allows you to request a set of messages (currently only mail messages, at some point will probably allow attachments/contacts/appts as well) returned to you as a Zip file.

For example, if you want a copy of all messages in your inbox, you could use the following URL:



ZCS-to-ZCS Migrations » Zimbra :: Blog

If you wanted all messages across all folders that were from Ross, you could use a query that returned only those:


The zip file will consist of a set of RFC822 files, with the name of the file based on the subject of the message.

Verified Against: Zimbra Collaboration 5.0.x Date Created: 4/25/2009
Article ID: Date Modified: 2017-02-16

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search