Sun logo      Previous      Contents      Index      Next     

Sun ONE Calendar Server 6.0 Programmer's Manual

Chapter 5
Web Calendar Access Protocol (WCAP) Overview

This chapter describes the Web Calendar Access Protocol (WCAP), which is a high level command-based protocol used to communicate with the Calendar Server. This chapter has the following sections:


The default client UI protocol for Calendar Server is an SHTML protocol, and is private. To retrieve calendar data in text/calendar and text/xml formats, use WCAP commands with the fmt-out parameter set to text/calendar or text/xml.

WCAP is a command based system consisting of client requests and server responses for transmitting calendaring data. WCAP returns calendaring data via HTTP. In most cases, Calendar Server receives data through URL-encoded arguments.

WCAP returns output in an HTTP message. The returned content body of the HTTP messages can consist of calendar data in the following formats:


In order to start the Calendar Server user interface (Calendar Express), you must specify fmt-out=text/html in the login command. This is the only instance of this format type.

WCAP commands consist of four general categories of usage:

Command Overview

Table 5-1 describes the high level list of commands supported in WCAP. For a detailed description of each command, see Chapter 6, "WCAP Commands."

Table 5-1  WCAP Command Overview 

WCAP Command



Add event links from one calendar to another.


Change the user’s password.


Administrator only: Check if user’s session ID is valid.


Create a new calendar.


Delete an existing calendar.


Delete both events and todos in a calendar(s) over a specific time period.


Delete events given a specific calid and uid/recurrence-ID pair.


Delete events in a calendar(s) over a specific time period.


Delete todos given a specified calid and userid/recurrence-ID pair.


Deletes todos in a calendar(s) over a specific time period.


Exports a calendar to a file.


Queries for components that have alarms to trigger over a specific time period.


Queries for components that had errors while sending group scheduling messages.


Queries for components that have changed, during the specified time range.


Queries the deletelog database for deleted components.


Queries for components over a specific time period, with filtering attributes.


Queries for one or more events by a unique identifier (UID, Recurrence ID, modifier).


Queries for one or more todos by a unique identifier (UID, Recurrence ID, modifier).


Returns all the timezones the server supports.


Returns calendar properties.


Returns calendar freebusy time.


Returns a set of random UIDs.


Returns the server times for the requested calids.


Returns user preferences and some server settings.


Imports a calendar from a file to a user’s calendar.


Authenticates a user and redirects to first HTML view.


Terminates the current user’s session and return to login screen.


Administrator only: Pings the calendar server.


Searches for a calendar with the specified parameter values.


Sets calendar properties.


Sets user preferences.


Stores events that are specified in application/urlencoded manner. For storing an even by passing properties in a URL.


Stores todos that are specified in the application/urlencoded manner.


Fetches events and returns the uid/rid of events not in the database.


Fetches todos and returns the uid/rid of events not in the database.


Returns the WCAP version that the server supports.

Session Identifiers

For many WCAP commands, you must specify the session identifier (id) that is returned by the login command. The session identifier ensures that data is accessible only to authenticated users with the required level of privilege or ownership.

When logging into the system, a user provides authentication of identity. The default authentication mechanism uses plain-text passwords and user names. Calendar Server generates the session identifier only when authentication is successful. The identifier then serves as proof of authentication in subsequent calendaring operations.

You can customize the authentication mechanism to use a local or external authentication scheme. See Chapter 2, "CSAPI Reference," for the section "csIAccessControl."

Hosted (Virtual) Domain Mode

If your LDAP is set up to use hosted (virtual) domains, all WCAP commands you issue must have fully qualified user IDs and calendar IDs (calid), for example

In order to be in hosted domain mode, the following ics.conf parameter must be set as shown:”y”

See your Calendar Server administrator if you do not know whether you are using hosted domains.

The following two example WCAP commands demonstrate the difference between calid values for non-hosted domain mode and hosted domain mode.

Not in hosted domain mode:

http://webcalendarserver/get_userprefs.wcap?id=b5q2o8ve2rk02nv9t6&   calid=jdoe&fmt-out=text/calendar

In hosted domain mode:


Command Formats

The plug-in architecture of Calendar Server allows it to support multiple command formats. Both client and server can use a variety of data formats to meet various ISP needs.

The command protocol uses HTTP, and follows the standards defined by the WC3 URL specifications.

WCAP in Calendar Server consists of JavaScript objects formatted as XML or iCalendar, communicated as HTML documents over HTTP on both the client and server side. Refer to the Sun ONE Calendar Server 6.0 Release Notes for recommended browser versions for client interfaces.


There is a limit to the number of characters that may be passed in for each parameter. The limit per parameter is 1024 characters.

Client Request Formats

Clients submit command requests to the Calendar Server in either Universal Resource Identifier (URI) data format, or with one of three HTML forms.

Command Format



Requests from client submitted using standard URI syntax.

HTML Form - urlencoded

Requests from client submitted using native JavaScript objects.

HTML Form - text/xml

Requests from client submitted using JavaScript objects formatted as XML.

HTML Form - text/calendar

Requests from client submitted using JavaScript objects formatted as iCalendar.

URI Format

Use the following format to submit a URI request:


Multiple items are delimited by semicolons. If a string contains a semicolon character, replace the semicolon with its quoted-printable equivalent, %3B. For example, to represent the string “gh;i” in a list of IDs, use the following:


See also "Common Topics List", in Chapter 6, "WCAP Commands."


Submit a form with method=[GET|POST] and action=command (where command is the command to execute). Parameters need to be formatted as specified in the encoding.


The maximum length for WCAP parameters is 1024 characters.

Client Side Event Notification

All client side JavaScript code in the parent frame of the response page is required to implement a method called CalcommandCallback(), where command is the name of the command requested. This callback will be invoked when the HTML response is completed loading.

The above commands when used with HTTP GET are simply for data retrieval.

The above commands when used with HTTP POST are for data modifications (including creation/deletion).

Server Response Formats

Calendar Server responds to client requests by serving HTML containing JavaScript objects.You can configure a response format preference for a server, a user, or an individual request.

The client may request output in either text/calendar or text/xml formats. The following table gives a brief description of each response format:

Response Format


HTML with JavaScript objects - text/calendar

Responses are in HTML, containing JavaScript formatted as iCalendar objects. This is the default format.

HTML with JavaScript objects - text/xml

Responses are in HTML, containing JavaScript formatted as XML objects

Previous      Contents      Index      Next     

Copyright 2003 Sun Microsystems, Inc. All rights reserved.