Retrieve calendar events and todos.
Parameter |
Type |
Purpose |
Required |
Default |
---|---|---|---|---|
attrset |
integer (0,1) |
Allows the user to indicate to the server if they want to retrieve the complete event or task data from the server, or if they only want a subset of the data for each matching component returned. Intended to minimize the amount of data returned and thereby the amount of processing a client must do. 0 = Returns the following parameters: uid, dtstart, dtend, summary. 1 = Returns the following parameters: uid, rrule, dtstart, dtend, summary, class, location, valarm. 2 = Returns the full event. |
N |
2 |
calid |
string |
A semicolon-separated list of calendar identifiers. The calid can be supplied in two formats:
|
N |
Current user’s calid |
component-type |
keyword (event, todo, all) |
Indicates which components to return: event returns only eventstodo returns only todosall returns both events and todos If an invalid value is passed in, the system assumes all. |
N |
all |
compressed |
integer (0,1) |
This parameter is deprecated in this release and might be deleted in future releases. For compressed=0, returns less data. Specifically, it does not return the following parameters:rrules, rdates, exrules, and exdates. For compressed=1, all recurrence data is returned. |
N |
0 |
compstate |
semicolon-separated list of component state keywords |
The list of component states to fetch. For compstate values, see Fetching Component State Data Using Calendar Server WCAP |
N |
ALL |
dtend |
Date Time string |
End time and date of events to be returned. A value of 0 means fetch all events. |
N |
0 |
dtstart |
Date Time string |
Start time and date of events to be returned. A value of 0 means fetch all events from the beginning of time. |
N |
0 |
emailorcalid |
integer (0, 1) |
0 = Returns calid in calendar address part of the ATTENDEE or ORGANIZER property and returns the RFC 822 address of the invitee or organizer in X-S1CS-EMAIL. 1 = Returns the RFC 822 compliant email address in the calendar address part of the ATTENDEE or ORGANIZER property, and returns the calid in X-S1CS-CALID. |
N |
0 |
filter |
string |
A string containing a name-value pair representing a filter for an event or todo. The name can be any valid event or todo RFC 2445 compliant property. The value is what to match in the component. Only single valued filters are supported. For example: CATEGORY=birthday Various partial matches are allowed using *, for example:
|
N |
NULL |
emailorcalid |
integer (0, 1) |
0 = The calid is returned in the calendar address part of the ATTENDEE and ORGANIZER properties. The X-Token X-S1CS-EMAIL has the RFC 822 email address of the invitee or organization. 1 = The email address is returned in the calendar address part of the ATTENDEE and ORGANIZER properties. The X-Token X-S1CS-CALID contains the calid value. |
N |
0 |
fetchattach |
integer (0, 1) |
0 = Returns information about the attachments. 1 = Returns the attachment itself. |
N |
0 |
fetchorder |
integer |
Specifies the order in which the events and todos are returned. The values are:
|
N |
0 |
filter |
string |
Name/value pair that represents a filter for an event. The left side is any valid property of an event or todo from RFC 2445. Only single valued filters are currently supported. For example: filter=(ATTENDEE=jdoe@sesta.com) where the left side of the value is a property from RFC 2445 and the right side is the value to match in the events and todos. The following are the only supported properties for filtering:
|
N |
NULL |
fmt-out |
string |
The format for the returned data. Two format types: text/calendar text/xml |
Y |
text/calendar |
id |
unique identifier string |
The session identifier. |
Y |
N/A |
invitecount |
integer (0, 1) |
1 = Requests the server to return the open invitations count, that is, events where PARSTAT=needs-action. The integer count is returned in the X-Token X-S1CS-CALPROPS-INVITATION-COUNT. if more than one calid is specified in the calid parameter, the open invitation count for each calendar is returned in the corresponding iCal or XML block. 0 = Count not requested. |
N |
0 |
invitecount |
integer (0, 1) |
0 = Do not return a count of the open invitations. Open invitations are events and todos where PARTSTAT=needs-action. 1 = Returns the count of open invitations in X-S1CS-CALPROPS-INVITATION-COUNT If more than one calid is specified, the open invitation count for each calendar is returned in the corresponding iCal or XML block. |
N |
0 |
maxResults |
integer |
Currently not implemented. The maximum number of events and todos to be returned. When 0, no maximum is applied and the command returns all events and todos found. |
N |
0 |
recurring |
integer (0, 1) |
1 = Return all components in compressed form. The compressed form has master entry plus exceptions. 0 = Return components as individual instances, without master record and exceptions. |
N |
0 (not compressed) |
relativealarm |
integer (0, 4) |
Return the alarm as relative or absolute. 0 = Return alarm values as absolute. 4 = Return alarms as originally created. |
N |
0 (absolute) |
searchOpts |
integer (0,1,2,3) |
How to perform the search. One of the following: 0 = CONTAINS 1 = BEGINS_WITH 2 = ENDS_WITH 3 = EXACT |
N |
0 |
tzid |
time zone ID string |
Default time zone to use if dtstart, or dtend parameters are not in Zulu time. For example, “America/Los_Angeles” |
N |
server’s default time zone |
tzidout |
time zone ID string |
Time zone to report returned data in. |
N |
Zulu time |
Use this command to retrieve properties, events, and todos from one or more specified calendars.
The server returns data in the format specified by the fmt-out parameter. If this parameter is not passed, the data is returned in the default text/calendar format.
For each calendar specified in calid, the server returns the calendar's properties and the events and todos of that calendar that fall within the range specified by dtstart and dtend.
Tasks returned by this WCAP Command:
Tasks due within the date range
Overdue tasks
Tasks completed within the date range
Tasks that are never due but have a start date within the range
If the times specified in the dtstart and dtend parameters is not Zulu time, the system uses the time zone specified in the tzid parameter to translate the times into Zulu time for data retrieval. If the tzid parameter is missing, the system uses the server’s default time zone.
The system uses the tzidout parameter to determine what time zone to translate retrieved data into before returning it. If the tzidout parameter is missing, the system returns the data in Zulu time.
If neither the starting nor ending date-time is specified, the server returns all events and todos, up to the specified maximum.
If the operation is successful, the error number of 0 is appended to the error string. If a calendar cannot be accessed or is missing, the error number is appended to the error string.
The server returns data in the format specified by the fmt-out parameter. If this parameter is not passed, the data is returned in the default text/calendar format.
If you specify a maximum n, the command returns up to the first n events and first n todos in the specified range. For example, if you specify a maxResults value of 75, the returned data would contain the following variables
var maxResults=75 /* maximum cap passed in */ var size=75 /* event size is capped to 75 */ var todosize=28 /* todo size not affected since it is less than 75 */
If the maxResults parameter is set to 0 or is not passed, then the command does not cap the number of returned components, and the returned data does not contain the var maxResults statement.
If the operation is successful, the error number of 0 is appended to the error string. If a calendar cannot be accessed or is missing, the error number is appended to the error string.
Example 1
This example fetches components for the current user from Dec. 1, 2001 to Jan. 31, 2002, using the following URL:
http://calendarserver/fetchcomponents_by_range.wcap ?id=bes6bbe2mu98uw9 &dtstart=20011201T000000Z &dtend=20020131T000000Z &fmt-out=text/calendar
It returns one event and one todo for this period:
BEGIN:VCALENDAR PRODID:-//SunJavaSystem/Calendar Hosting Server//EN METHOD:PUBLISH VERSION:6.0 X-NSCP-CALPROPS-LAST-MODIFIED:20011208T005613Z X-NSCP-CALPROPS-CREATED:20010913T223336Z X-NSCP-CALPROPS-READ:999 X-NSCP-CALPROPS-WRITE:999 X-NSCP-CALPROPS-RELATIVE-CALID:jdoe X-NSCP-CALPROPS-NAME:John Doe X-NSCP-CALPROPS-LANGUAGE:en X-NSCP-CALPROPS-PRIMARY-OWNER:jdoe X-NSCP-CALPROPS-TZID:America/Los_Angeles X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^c^WDEIC^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^a^RSF^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^a^frs^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^c^^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^a^frs^ X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^c^dw^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^a^rs^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^c^w^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^p^r^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^p^r^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^p^r^g X-NSCP-CALPROPS-RESOURCE:0 BEGIN:VEVENT UID:3c11625900005ffe00000011000010b7 DTSTAMP:20011208T015014Z SUMMARY:eventA DTSTART:20011225T133000Z DTEND:20011225T143000Z CREATED:20011208T004409Z LAST-MODIFIED:20011208T010857Z PRIORITY:0 SEQUENCE:4 ORGANIZER;SENT-BY="jdoe@sesta.com" ;X-NSCP-ORGANIZER-UID=jdoe ;X-NSCP-ORGANIZER-SENT-BY-UID=jdoe:jdoe STATUS:CONFIRMED TRANSP:OPAQUE ATTENDEE;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED; CN="John Smith";RSVP=TRUE;X-NSCP-ATTENDEE-GSE-STATUS=2:jsmith X-NSCP-ORIGINAL-DTSTART:20020210T190000Z X-NSCP-LANGUAGE:en BEGIN:VALARM ACTION:EMAIL TRIGGER;VALUE=DATE-TIME:20011225T123000Z ATTENDEE:MAILTO:jsmith@company22.com END:VALARM X-NSCP-DTSTART-TZID:America/Los_Angeles X-NSCP-TOMBSTONE:0 X-NSCP-ONGOING:0 X-NSCP-ORGANIZER-EMAIL:jdoe@sesta.com X-NSCP-GSE-COMPONENT-STATE;X-NSCP-GSE-COMMENT="REQUEST-COMPLETED": 31074 END:VEVENT BEGIN:VTODO UID:3c1162e200207ff600000015000010b7 DTSTAMP:20011208T015014Z SUMMARY:todoA DTSTART:20011208T004626Z DUE:20020120T141500Z CREATED:20011208T004626Z LAST-MODIFIED:20011208T011000Z PRIORITY:0 SEQUENCE:3 PERCENT-COMPLETE:0 ORGANIZER;SENT-BY="jdoe@sesta.com" ;X-NSCP-ORGANIZER-UID=jdoe ;X-NSCP-ORGANIZER-SENT-BY-UID=jdoe:jdoe STATUS:NEEDS-ACTION X-NSCP-ORIGINAL-DTSTART:20011208T004626Z X-NSCP-LANGUAGE:en BEGIN:VALARM ACTION:EMAIL TRIGGER;VALUE=DATE-TIME:20020120T131500Z ATTENDEE:MAILTO:jsmith@company22.com END:VALARM X-NSCP-DUE-TZID:America/Los_Angeles X-NSCP-TOMBSTONE:0 X-NSCP-ONGOING:0 X-NSCP-ORGANIZER-EMAIL:jdoe@sesta.com X-NSCP-GSE-COMPONENT-STATE;X-NSCP-GSE-COMMENT="PUBLISH-COMPLETED": 5538 END:VTODO X-NSCP-WCAP-ERRNO:0 END:VCALENDAR
Example 2
The second example fetches all components for calendars jdoe and susan between Dec. 1, 2001 to Jan. 31, 2002.
http://calendarserver/fetchcomponents_by_range.wcap ?id=bes6bbe2mu98uw9 &calid=jdoe;susan &dtstart=20020101T000000Z &dtend=20020202T000000Z &fmt-out=text/calendar |
The following events and todos are returned:
BEGIN:VCALENDAR PRODID:-//SunJavaSystem/Calendar Hosting Server//EN METHOD:PUBLISH VERSION:6.0 X-NSCP-CALPROPS-LAST-MODIFIED:20011208T005613Z X-NSCP-CALPROPS-CREATED:20010913T223336Z X-NSCP-CALPROPS-READ:999 X-NSCP-CALPROPS-WRITE:999 X-NSCP-CALPROPS-RELATIVE-CALID:jdoe X-NSCP-CALPROPS-NAME:John Doe X-NSCP-CALPROPS-LANGUAGE:en X-NSCP-CALPROPS-PRIMARY-OWNER:jdoe X-NSCP-CALPROPS-TZID:America/Los_Angeles X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^c^WDEIC^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^a^RSF^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^a^frs^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^c^^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^a^frs^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^c^dw^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^a^rs^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^c^w^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^p^r^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^p^r^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^p^r^g X-NSCP-CALPROPS-RESOURCE:0 BEGIN:VEVENT UID:3c1162b3000051c300000013000010b7 DTSTAMP:20011208T011645Z SUMMARY:Joe’s event DTSTART:20020110T110000Z DTEND:20020110T120020Z CREATED:20011208T004539Z LAST-MODIFIED:20011208T011638Z PRIORITY:0 SEQUENCE:4 ORGANIZER;SENT-BY="jdoe@sesta.com"; X-NSCP-ORGANIZER-UID=jdoe; X-NSCP-ORGANIZER-SENT-BY-UID=jdoe:jdoe STATUS:CONFIRMED TRANSP:OPAQUE ATTENDEE;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED; CN="John Smith";RSVP=TRUE;X-NSCP-ATTENDEE-GSE-STATUS=2:jsmith X-NSCP-ORIGINAL-DTSTART:20021225T213000Z X-NSCP-LANGUAGE:en BEGIN:VALARM ACTION:EMAIL TRIGGER;VALUE=DATE-TIME:20020210T100000Z ATTENDEE:MAILTO:jsmith@company22.com END:VALARM X-NSCP-DTSTART-TZID:America/Los_Angeles X-NSCP-TOMBSTONE:0 X-NSCP-ONGOING:0 X-NSCP-ORGANIZER-EMAIL:jdoe@sesta.com X-NSCP-GSE-COMPONENT-STATE; X-NSCP-GSE-COMMENT="REQUEST-COMPLETED":31074 END:VEVENT BEGIN:VTODO UID:3c1162e200207ff600000015000010b7 DTSTAMP:20011208T011645Z SUMMARY:Joe’s Todo DTSTART:20011208T004626Z DUE:20020120T141500Z CREATED:20011208T004626Z LAST-MODIFIED:20011208T011000Z PRIORITY:0 SEQUENCE:3 PERCENT-COMPLETE:0 ORGANIZER;SENT-BY="jdoe@sesta.com"; X-NSCP-ORGANIZER-UID=jdoe; X-NSCP-ORGANIZER-SENT-BY-UID=jdoe:jdoe STATUS:NEEDS-ACTION X-NSCP-ORIGINAL-DTSTART:20011208T004626Z X-NSCP-LANGUAGE:en BEGIN:VALARM ACTION:EMAIL TRIGGER;VALUE=DATE-TIME:20020120T131500Z ATTENDEE:MAILTO:jdoe@sesta.com END:VALARM X-NSCP-DUE-TZID:America/Los_AngelesX-NSCP-TOMBSTONE:0 X-NSCP-ONGOING: X-NSCP-ORGANIZR-EMAIL:jdoe@sesta.com X-NSCP-GSE-COPONENT-STATE; X-NSCP-GSE-COMMENT="PUBLISH-COMPLETED":6538 END:VTODO X-NSCP-WCAP-ERRNO:0 END:VCALENDAR BEGIN:VCALENDAR PRODID:-//SunJavaSystem/Calendar Hosting Server//EN METHOD:PUBLISH VERSION:6.0 X-NSCP-CALPROPS-LAST-MODIFIED:19700101T000000Z X-NSCP-CALPROPS-CREATED:19700101T000000Z X-NSCP-CALPROPS-READ:999 X-NSCP-CALPROPS-WRITE:999 X-NSCP-CALPROPS-RELATIVE-CALID:susan X-NSCP-CALPROPS-RESOURCE:0 BEGIN:VCALENDAR PRODID:-//SunJavaSystem/Calendar Hosting Server//EN METHOD:PUBLISH VERSION:6.0 X-NSCP-CALPROPS-LAST-MODIFIED:20011010T001050Z X-NSCP-CALPROPS-CREATED:20000929T180436Z X-NSCP-CALPROPS-READ:999 X-NSCP-CALPROPS-WRITE:999 X-NSCP-CALPROPS-RELATIVE-CALID:susan X-NSCP-CALPROPS-NAME:default X-NSCP-CALPROPS-PRIMARY-OWNER:susan X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^c^WDEIC^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^a^RSF^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^frs^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^c^^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:fred^a^r^g X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:fred^c^^g X-NSCP-CALPROPS-RESOURCE:0 BEGIN:VEVENT UID:3c1162b3000051c300000013000010b7 DTSTAMP:20011208T011645Z SUMMARY: Susan’s event DTSTART:20020110T110000Z DTEND:20020110T120020Z CREATED:20011208T004539Z LAST-MODIFIED:20011208T011638Z PRIORITY:0 SEQUENCE:4 ORGANIZER;SENT-BY="susan@sesta.com"; X-NSCP-ORGANIZER-UID=susan; X-NSCP-ORGANIZER-SENT-BY-UID=susan:susan STATUS:CONFIRMED TRANSP:OPAQUE ATTENDEE;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVIDUAL; PARTSTAT=ACCEPTED;CN="Mary Anderson";RSVP=TRUE; X-NSCP-ATTENDEE-GSE-STATUS=2:marya X-NSCP-ORIGINAL-DTSTART:20021225T213000Z X-NSCP-LANGUAGE:en BEGIN:VALARM ACTION:EMAIL TRIGGER;VALUE=DATE-TIME:20020210T100000Z ATTENDEE:MAILTO:marya@company22.com END:VALARM X-NSCP-DTSTART-TZID:America/Los_Angeles X-NSCP-TOMBSTONE:0 X-NSCP-ONGOING:0 X-NSCP-ORGANIZER-EMAIL:susan@seata.com X-NSCP-GSE-COMPONENT-STATE; X-NSCP-GSE-COMMENT="REQUEST-COMPLETED":131074 END:VEVENT BEGIN:VTODO UID:3c1162e200207ff600000015000010b7 DTSTAMP:20011208T011645Z SUMMARY:susan’s todo DTSTART:20011208T004626Z DUE:20020120T141500Z CREATED:20011208T004626Z LAST-MODIFIED:20011208T011000Z PRIORITY:0 SEQUENCE:3 PERCENT-COMPLETE:0 ORGANIZER;SENT-BY="susan@sesta.com"; X-NSCP-ORGANIZER-UID=crowe; X-NSCP-ORGANIZER-SENT-BY-UID=susan:susa STATUS:NEEDS-ACTION X-NSCP-ORIGINAL-DTSTART:20011208T004626Z X-NSCP-LANGUAGE:en BEGIN:VALARM ACTION:EMAIL TRIGGER;VALUE=DATE-TIME:20020120T131500Z ATTENDEE:MAILTO:susan@sesta.com END:VALARM X-NSCP-DUE-TZID:America/Los_Angeles X-NSCP-TOMBSTONE:0 X-NSCP-ONGOING:0 X-NSCP-ORGANIZER-EMAIL:mailto:susan@sesta.com X-NSCP-GSE-COMPONENT-STATE; X-NSCP-GSE-COMMENT="PUBLISH-COMPLETED":65538 END:VTODO X-NSCP-WCAP-ERRNO:0 END:VCALENDAR