Calendar Resource Management with the Google Data API

October 8, 2008 Matt Pruden

Matt Pruden

In many enterprises, there is no piece of real estate more scarce than an unoccupied conference room. With so much importance placed on conference rooms, their rigorous management is critical to a successful Google Apps deployment.

While Google Calendar offers a flexible system for reserving conference rooms, projectors, scooters, or any other shared resource, it does not provide a documented API for creating, updating, and deleting resources. Instead, you must manually manage resources through the Google Apps control panel. Manual management may work for a small number of resources but becomes unscalable when managing thousands.

However, creative developers can find just such a Google Data (GData) API for provisioning resources. In this post, we’ll explore how to create, read, update, and delete calendar resources using GData through cURL, the commonly available command line HTTP client.

Discovering Calendar Resource support in GData.

Each type of entry in Google, whether a spreadsheet row, user account, or nickname has a collection URL. In true REST fashion, a GET request to the collection URL will return a list of entries. For example, an GET request to will return a feed of calendar event entries. Likewise, a POST to this URL will add a new event entry to a calendar. So, to retrieve and create resources, we first need to discover the collection URL for calendar resources.

A calendar resource has many of the same characteristics as a user. For example, a calendar resource can be a meeting attendee and can be browsed by clicking “check guest and resource availability” in the Calendar user interface. Also, a calendar resource isn’t tied to a particular user when it is created. It is reasonable to believe that managing calendar resources through the API might closely mimic managing users through the provisioning API.

In the provisioning API, the collection URL for user accounts looks like this: What if we change user to resource resulting in a URL like this: The example below uses the cURL application to send a GET request to the new URL. For details on using cURL with GData, see Google’s documentation.

curl -s -k –header “Authorization: GoogleLogin auth=DQAAAH4AA” | tidy -xml -indent -quiet
xmlns:openSearch=”” xmlns:gCal=”″ xmlns:apps=”″ xmlns:gd=”″> 1970-01-01T00:00:00.000Z term=””/> type=”application/atom+xml” href=”″/> type=”application/atom+xml” href=”″/> href=”″/> 1 1970-01-01T00:00:00.000Z term=””/> Bldg 3, room 201 href=”″/> href=”″/> email=””>

We’ve found the collection URL for calendar resources! Now, we just need to determine the XML schema for an individual resource. A hour of trial and error results in the following schema:

term=”” />

Since Google already does a great job of explaining the GData API, this post will not repeat that information. Instead, you can use the collection URL and entry schema in the same fashion as the other GData APIs to create, read, update, and delete calendar resources.

Previous Article
Google Apps Auth Backend for Django

Tim Garthwaite Google loves Python. In fact, Google’s original web spider, which crawls the web to create i...

Next Article
Overcoming Customer Portal Object Access Limitations Using Proxies

Michael McLaughlin If you have ever tried exposing a Campaign, Contract, Lead, Opportunity,Pricebook, or Pr...