Calendar
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Recent Entries
Come On In, Rails-The Water's Warm
Shan's Simple Examples: File uploads with Flex and ColdFusion
Recent Comments
Google Calendar API - Creating a new Calendar with ColdFusion
Steve Julian said: When and where are you going to post the finished CFC's ? Thanks
[more]
Three Phases of Programmer Development
Pat Branley said: I normally think of those phase 2 people as 'programmers' and the phase 3 people as 'developers'.
I...
[more]
New Job Title: Front End Engineer
Sean Corfield said: Well, there's always the excellent Fusion Authority Quarterly Journal...
[more]
Down To The Wire: HTTP Sniffers
Brian M said: I second the mention of the Charles Web Debugging Proxy that Tariq mentioned. It is fantastic. It s...
[more]
New Job Title: Front End Engineer
Patrick said: Heya Sean. Good point. I never understood how they did things over there at SysCon, and I understand...
[more]
Archives By Subject
Business of Software (4) [RSS]
ColdFusion (318) [RSS]
Conferences (6) [RSS]
Databases (87) [RSS]
Flex & Flash (109) [RSS]
Fusebox (87) [RSS]
General Development (29) [RSS]
Google (9) [RSS]
Hardware (5) [RSS]
JVM & Java (132) [RSS]
Linux (20) [RSS]
Miscellaneous (254) [RSS]
Performance (8) [RSS]
SeeFusion (36) [RSS]
Shan's Simple Examples (6) [RSS]
User Interface (3) [RSS]
Windows (5) [RSS]
Archives By Poster
Daryl Banttari (10)
Nat Papovich (29)
Patrick Quinn (36)
Shannon Hicks (22)
Steve Nelson (21)
Tyson Vanek (3)
Google Calendar XML: Deciphering the Data
In my previous post we looked at getting a list of calendars using the Google API. We looked at how to make the request, but not what to do with the data Google sends back.
When you make a request for a list of calendars, Google sends the list back in an xml format. Some of it is fairly self explanatory but some of it is a bit of a mystery. For that matter I'm still not 100% certain what all of it is for, but I want to focus your attention on one area of data that is important.
First do this:
<cfinvokeargument name="subSessionToken" value="abcdefgYOURSUBSESSION">
<cfinvokeargument name="gsessionid" value="abcdefgYOURGSESSION">
<cfinvokeargument name="includeAllCalendars" value="0">
</cfinvoke>
<cfdump var="#getCalendars#">
This is assuming you've been following along with my other posts. When you run that code above it will display a data dump of the xml returned from Google.
Take a look at the "entry" sections. These are the individual calendars. (This is also assuming you've created at least one calendar) There should be an entry for each calendar. Drill down a little further and take a look at the various links, each calendar entry should have four links.
alternate - This URL gives you a list of all the entries for the calendar.
accessControlList - This URL gives you a list of who can modify the calendar
self - This URL provides the same basic information that you're looking at now, except for ONLY one calendar
edit - This URL is what you use for editing the entries in a calendar
I think what you'll find is that this is a very incomplete list of what you can do with the calendars. So personally i find this list to be a bit silly. For example, it doesn't display the URL for batch processing. Of course in the docs it will say things like "send a DELETE request to the calendar's edit URL" which is a pretty lame explanation. These URLs should be in the docs, not in the XML data.
What SHOULD be in this XML is the calendar ID. It's there, just hidden. If you look at each of those URLs you'll see the same string, most likely a URL-Encoded version of your gmail address, although not always. Basically on the end of each of those URLs is the ID for the calendar. If you look a little above the "link" values you'll see an "ID" value. But it's not just the calendar's ID, it's a full URL! Google doesn't give you the basic ID directly (because that would be too easy!) you have to extract it out of the "ID" URL. No, it's not hard, just messy.
That calendar ID (not the URL, the actual ID!) is important for our other methods. Here's how to extract it from the "ID" URL:
<cfoutput>#listlast(filelist.feed.entry[count].id.xmltext,"/")#</cfoutput>
</cfloop>
So that will loop over each calendar and display the calendar's actual ID for use with the other API methods. Now that we have the calendar ID, next we'll look at editing a calendar.
Goog Luck! -Steve Nelson

