Calendar Rest services (V1)

The document is currently under review. New versions will be deployed regularly.

This rest service class provides entry point for calendar resources.

Resource Description
GET /v1/calendar/ Returns all the available sub-resources of this API in JSON.
GET /v1/calendar/calendars/ Searches for calendars by a type (personal/group/shared), returns calendars that the user has access permission.
POST /v1/calendar/calendars/ Creates a calendar based on calendar attributes sent in the request body. Can be personal or group calendar. This accepts HTTP POST request, with JSON object (cal) represents a CalendarResource. Example: { name: "Calendar name", description: "Description of the calendar" }
GET /v1/calendar/calendars/{id} Search for a calendar by its id, in one of conditions: The authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the calendar has been shared with the user or with a group of the user.
PUT /v1/calendar/calendars/{id} Update a calendar specified by id, in one of conditions: the authenticated user is the owner of the calendar, OR for group calendars, the authenticated user has edit permission on the calendar. This accepts HTTP PUT request, with JSON object (calObj) in the request body, and calendar id in the path. All the attributes of JSON object are optional, any absent/invalid ones will be ignored. id, href and URLs attributes are Read-only.
DELETE /v1/calendar/calendars/{id} Deletes a calendar specified by id, in one of conditions: - the authenticated user is the owner of the calendar. - for group calendars, the authenticated user has edit permission on the calendar. - if it is a shared calendar, the calendar is not shared anymore (but not deleted).
GET /v1/calendar/calendars/{id}/ics Exports a calendar specified by id into iCal formated file, with one of conditions: The calendar is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the calendar has been shared with the user or with a group of the user.
GET /v1/calendar/events/{id} Searches for an event by id, in one of conditions: The calendar of the event is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the user is a participant of the event, OR the calendar of the event has been shared with the user or with a group of the user.
PUT /v1/calendar/events/{id} Updates an event specified by id, in one of conditions: The authenticated user is the owner of the calendar of the event, OR for group calendars, the user has edit permission on the calendar, OR the calendar has been shared with the user, with edit permission, OR the calendar has been shared with a group of the user, with edit permission. This accepts HTTP PUT request, with JSON object (evObject) in the request body, and event id in the path. All the attributes of JSON object are optional, any absent/invalid ones will be ignored. Read-only attributes: id and href, originalEvent, calendar, recurrentId will be ignored too.
DELETE /v1/calendar/events/{id} Deletes an event specified by id, in one of conditions: The authenticated user is the owner of the calendar of the event, OR for group calendars, the user has edit permission on the calendar, OR the calendar has been shared with the user, with edit permission, OR the calendar has been shared with a group of the user, with edit permission.
GET /v1/calendar/events/{id}/attachments Returns attachments of an event specified by event id, in one of conditions: The calendar of the event is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the user is a participant of the event, OR the calendar has been shared with the user or with a group of the user.
POST /v1/calendar/events/{id}/attachments Creates attachments for an event specified by id, in one of conditions: The authenticated user is the owner of the calendar of the event, OR for group calendars, the user has edit permission on the calendar, OR the calendar has been shared with the user, with edit permission, OR the calendar has been shared with a group of the user, with edit permission. This accepts HTTP POST request, with files in HTTP form submit request, and the event id in path.
GET /v1/calendar/calendars/{id}/events Returns events of a calendar specified by id, in one of conditions: The calendar is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the user is a participant of the event, OR the calendar has been shared with the user or with a group of the user.
POST /v1/calendar/calendars/{id}/events Creates an event in a calendar specified by id, in one of conditions: The authenticated user is the owner of the calendar, OR for group calendars, the user has edit permission on the calendar, OR the calendar has been shared with the user, with edit permission, OR the calendar has been shared with a group of the user, with edit permission. This accepts HTTP POST request, with JSON object (evObject) in the request body.
GET /v1/calendar/events/{id}/occurrences Returns occurrences of a recurring event specified by id, in one of conditions: the calendar of the event is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the user is a participant of the event, OR the calendar has been shared with the user or with a group of the user.
GET /v1/calendar/calendars/{id}/tasks Returns tasks of a calendar specified by id, in one of conditions: The calendar is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the task is delegated to the user, OR the calendar has been shared with the user or with a group of the user.
POST /v1/calendar/calendars/{id}/tasks Creates a task for a calendar specified by id, in one of conditions: The user is the owner of the calendar, OR for group calendars, the user has edit permission on the calendar, OR the calendar has been shared with the user, with edit permission, OR the calendar has been shared with a group of the user, with edit permission. This accepts HTTP POST request, with JSON object (evObject) in the request body. Example: { "name": "...", "note": "...", "categoryId": "", "from": "...", "to": "...", "delegation": "...", "", "priority": "", "reminder": , "status": "" }
GET /v1/calendar/tasks/{id} Returns a task specified by id, in one of conditions: the calendar of the task is public; OR the authenticated user is the owner of the calendar; OR the user belongs to the group of the calendar; OR the task is delegated to the user; OR the calendar has been shared with the user or with a group of the user.
PUT /v1/calendar/tasks/{id} Updates a task specified by id, in one of conditions: the calendar of the task is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the task is delegated to the user, OR the calendar has been shared with the user or with a group of the user. This accepts HTTP PUT request, with JSON object (evObject) in the request body, and task id in the path. All the attributes are optional, any absent/invalid attributes will be ignored. id, href, calendar are Read-only. For example: { "name": "...", "note": "...", "categoryId": "", "from": "...", "to": "...", "delegation": "...", "", "priority": "", "reminder": , "status": "" }
DELETE /v1/calendar/tasks/{id} Deletes a task specified by id, in one of conditions: the calendar of the task is public; OR the authenticated user is the owner of the calendar; OR the user belongs to the group of the calendar; OR the task is delegated to the user; OR the calendar has been shared with the user or with a group of the user.
GET /v1/calendar/attachments/{id} Queries an attachment (of an event/task) by attachment id, in one of conditions: The calendar of the event/task is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the user is a participant of the event or is delegated to the task, OR the calendar has been shared with the user or with a group of the user.
DELETE /v1/calendar/attachments/{id} Deletes an attachment (of an event/task) specified by attachment id, in one of conditions: The calendar of the event/task is public, OR the authenticated user is the owner of the calendar, OR the user belongs to the group of the calendar, OR the user is a participant of the event or is delegated to the task, OR the calendar has been shared with the user or with a group of the user.
GET /v1/calendar/categories Returns the categories (common and personal categories).
GET /v1/calendar/categories/{id} Returns a category specified by id if it is a common category or is a personal category of the user.
GET /v1/calendar/feeds/{id} Gets a feed with the given id. The user must be the owner of the feed.
PUT /v1/calendar/feeds/{id} Updates a feed with the given id. The user must be the owner of the feed. This accepts HTTP PUT request, with JSON object (feedResource) in the request body, and feed id in the path. All the feed attributes are optional, any absent/invalid attributes will be ignored. id and href are auto-generated and cannot be edited by the users. For example: { "name": "..", "calendarIds": "...", "..." }
DELETE /v1/calendar/feeds/{id} Deletes a feed with the given id. The user must be the owner of the feed.
GET /v1/calendar/feeds/{id}/rss Gets the RSS stream of a feed with the given id. The user must be the owner of the feed.
GET /v1/calendar/invitations/{id} Returns an invitation with specified id if one of conditions: The authenticated user is the participant of the invitation, OR the user has edit permission on the calendar of the event of the invitation.
PUT /v1/calendar/invitations/{id} Replies to an invitation specified by id. The user must be the invitee.
DELETE /v1/calendar/invitations/{id} Deletes an invitation with specified id. The authenticated user must have edit permission on the calendar.
GET /v1/calendar/events/{id}/invitations/ Returns invitations of an event specified by id when: the authenticated user is the participant of the invitation, OR the authenticated user has edit permission on the calendar of the event.
POST /v1/calendar/events/{id}/invitations/ Creates an invitation in an event specified by event id, in one of conditions: the authenticated user is the participant of the event, OR the authenticated user has edit permission on the calendar of the event. This accepts invitation resource in request body, for example : {"participant":"root","status":""}.