If your organization's event data is stored and maintained in a database, you can create a connector program that periodically outputs that data to iCalendar (.ics) files. Then, through an HTTP PUT operation, you can programmatically upload the iCal files to your Trumba® calendars.
Note This topic assumes that you are familiar with programming languages, the http protocol, and how URL parameters work, and that you can easily find your way around HTML or other web programming code.
The iCalendar (.ics) import allows events to be created, updated, and deleted on a Trumba calendar by sending an iCalendar (RFC 2445) format file to the Trumba server through an HTTP PUT operation.
To update previously imported events, you can modify data in the original iCal file and reimport the file without altering unchanged event data or duplicating events.
Because each iCal file you send through an HTTP PUT operation can contain only a single VCALENDAR component, you must initiate a separate operation for each event you want to delete. Learn more.
Sending a file to the Trumba server requires HTTP BASIC authentication. The password is sent via clear text so we recommended (but do not require) that you perform the HTTP PUT operation via a secure https connection.
The HTTP PUT operation requires a URL. The example shown below represents the base URL. For the last portion of the URL, you must use the calendar's web name.
Example URL for a calendar with the web name Foobar: https://www.trumba.com/service/Foobar.ics
The URL can also include the following query string parameter:
|Parameter||Description||Allowed Values||Default Value|
The delta parameter controls whether the incoming feed is considered to be a full feed of data or only changes.
You can assign any event ID (UID) values you want to the events you're importing as long as each event UID added to a Trumba calendar or any of its sub-calendars is unique.
If you export calendar data from another program before importing it into Trumba, that program typically generates a unique ID for each event.
Although you can use the same UIDs for events in different calendars, we recommend that you implement a method that generates unique event IDs across all of your calendars.
For recommendations on UID formats, refer to RFC2445.
Delete an event from your Trumba calendar by using an HTTP PUT operation to upload an iCal file that specifies the CANCEL method and supplies only the event UID. For example:
NOTE Each iCalendar file sent using an HTTP PUT operation can include only a single VCALENDAR component. Therefore, you must send a separate HTTP PUT operation using the iCalendar CANCEL method for each event you want to delete.
The response to the HTTP PUT operation contains an XML structure with a root "Response" node and one or more "ResponseMessage" nodes providing information and validation feedback. The following messages may be returned. Response messages may include the UID of the related event and a line number in the feed file where appropriate.
|2101||Property not recognized||Warning|
|2102||Content line is invalid||Warning|
|2103||DateTime is invalid||Warning|
|2104||UTC offset is invalid||Warning|
|2105||Duration is invalid||Warning|
|3101||ICS file must contain a single VCALENDAR||Error|
This section provides a simple code snippet that performs an HTTP PUT of a .ics file. For brevity, it intentionally does not use error handling logic that would be present in most programs.
The sample code will not work unmodified. Various parameters (in CAPS in this example), such as authentication information and the path to the .ics file, must be updated to reflect your account and published calendar name.
The resultant xml response stream output to the console might look like this: