Zimbra REST API Reference:Get Calendar: Difference between revisions
Line 27: | Line 27: | ||
<ul> | <ul> | ||
<li><code>fmt</code>. Optional. The response format. Defaults to <code>ics</code></li> | <li><code>fmt</code>. Optional. The response format. Defaults to <code>ics</code></li> | ||
<li><code>start</code>. Optional. The start time range (milliseconds | yyyy/dd/mm | mm/dd/yyy | [[#relative dates]] ).</li> | <li><code>start</code>. Optional. The start time range (milliseconds | yyyy/dd/mm | mm/dd/yyy | [[ZCS_6.0:Zimbra_REST_API_Reference:Get_Calendar#Relative_Dates|relative dates]] ).</li> | ||
<li><code>end</code>. Optional. The end time range (milliseconds | yyyy/dd/mm | mm/dd/yyy | [[#relative dates]] ).</li> | <li><code>end</code>. Optional. The end time range (milliseconds | yyyy/dd/mm | mm/dd/yyy | [[ZCS_6.0:Zimbra_REST_API_Reference:Get_Calendar#Relative_Dates|relative dates]] ).</li> | ||
<li><code>query</code>. Optional. A query string.</li> | <li><code>query</code>. Optional. A query string.</li> | ||
</ul> | </ul> | ||
Line 34: | Line 34: | ||
==== Relative Dates ==== | ==== 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. | 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): | ||
<ul> | |||
<li>m(onths)</li> | |||
<li>mi(nutes)</li> | |||
<li>d(ays)</li> | |||
<li>w(eeks)</li> | |||
<li>h(ours)</li> | |||
<li>y(ears)</li> | |||
</ul> | |||
Examples 1day 1 day from now | Examples: | ||
<pre> | |||
1day 1 day from now | |||
</pre> | |||
<pre> | |||
+2days 2 days from now | +2days 2 days from now | ||
</pre> | |||
<pre> | |||
p1day 1 day from now | p1day 1 day from now | ||
</pre> | |||
<pre> | |||
-2days 2 days ago | -2days 2 days ago | ||
</pre> | |||
<pre> | |||
+60mi 60 minutes from now | +60mi 60 minutes from now | ||
</pre> | |||
<pre> | |||
+1week 1 week from now | +1week 1 week from now | ||
</pre> | |||
<pre> | |||
+6mon 6 months from now | +6mon 6 months from now | ||
</pre> | |||
<pre> | |||
1year 1 year from now | 1year 1 year from now | ||
</pre> | |||
==== HTML Format Parameters ==== | ==== HTML Format Parameters ==== |
Revision as of 17:33, 19 January 2010
<< Back to Zimbra REST API Reference
REST API Method: Get Calendar
Gets the appointments from the calendar. The default folder is "calendar" but user-defined folders are also supported.
URL
http://localhost:7070/home/john.doe/calendar?{params}
HTTP Method
GET
Formats
ics,json,xml,rss,atom,html
(Go to Response Formats)
Requires Authentication
true
(Go to Authentication)
Parameters
fmt
. Optional. The response format. Defaults toics
start
. Optional. The start time range (milliseconds | yyyy/dd/mm | mm/dd/yyy | relative dates ).end
. Optional. The end time range (milliseconds | yyyy/dd/mm | mm/dd/yyy | relative dates ).query
. Optional. A query string.
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)
Examples:
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
HTML Format Parameters
view
. Optional. Designates the display when using thehtml
format. Options include:day, week, workWeek, month
.date
. Optional. Designates the date to display when using thehtml
format. Format is date=[yyyymmdd]. For example, 2/15/2010 isdate=20100215
.notoolbar
. Optional. Specifies to not include the toolbar (notoolbar=1
)color
. Optional. The color of the appointment text. Options include:Value Color 0 defaultColor 1 blue 2 cyan 3 green 4 purple 5 red 6 yellow 7 pink 8 gray 9 orange
Usage Examples
Download the calendar as an iCalendar (ICS) file:
http://localhost:7070/home/john.doe/calendar
http://localhost:7070/home/john.doe/calendar?fmt=ics
Retrieve the calendar in XML format:
http://localhost:7070/home/john.doe/calendar?fmt=xml
Retrieve the calendar from the user-defined folder "MyHolidays" in JSON format:
http://localhost:7070/home/john.doe/myholidays?fmt=json
Retrieve the calendar in JSON format:
http://localhost:7070/home/john.doe/calendar?fmt=json
Retrieve the calendar HTML "month" view:
http://localhost:7070/home/john.doe/calendar.html
http://localhost:7070/home/john.doe/calendar?fmt=html
Retrieve the calendar HTML "workWeek" view:
http://localhost:7070/home/john.doe/calendar?fmt=html&view=workWeek
Retrieve the calendar HTML "day" view on January 23, 2009 (01/23/2009):
http://localhost:7070/home/john.doe/calendar?fmt=html&view=day&date=20090123