I created an AS3 library for Google Calendar API. This library has following features implemented.
- Authenticating to the Calendar service
- Retrieving calendar lists
- Retrieving all calendars
- Retrieving only calendars that a user owns
- Managing calendars
- Creating new calendars
- Updating existing calendars
- Deleting calendars
- Retrieving events for a specified date range
- Creating single-occurrence events
- Updating events
- Deleting events
- Reminders and Notifications
Please download the library from this URL http://as3googlecalendarlib.googlecode.com
All you have to do is to use the classes in the com.adobe.googlecalendar.services package to use any of the feature mentioned above.
This library still needs to be improved, in terms of adding more features, code cleanup, documentation and implementing any suggestions. I will try to complete this as soon as possible.
If you are interested in contributing to this library, please let me know. If you want to use this and want to know how to, leave a comment.
I am in process of creating an AIR application using this API, I will be posting soon.


January 29, 2009 at 8:29 pm
Nice idea. I will take a look.
January 30, 2009 at 9:39 am
Very cool, I’ll check it out!
February 4, 2009 at 4:01 pm
Good one
It will be of great use for many of us.
February 5, 2009 at 10:43 am
Hi Sujit, I would like to use your library, I have searched the provided google code link but I didn’t find any file to download. Can you provide a link to download it? Thanks.
February 6, 2009 at 2:56 pm
I’m very interested in using your library and its functionality in my web app, but am brand new to Flex programming. Please explain how I can put into my app and make it work. thanks
February 10, 2009 at 11:09 am
Hi Charles,
Please download the code as explained in this URL http://code.google.com/p/as3googlecalendarlib/source/checkout
Hope this helps.
February 10, 2009 at 11:17 am
Hi Tmobetta,
I am working on an AIR application which will use this API and will be posting that soon. Please download the API and look at the classes in com.adobe.googlecalendar.services package. Names of the functions are pretty straightforward. I will post sample ASAP
February 10, 2009 at 1:45 pm
There’s a sample FLEX MXML application for this library ? Some help?
Thanks
February 11, 2009 at 6:40 am
Hi all,
I am working on a sample application using this API .. I promise to post it by 16th Feb …..
February 19, 2009 at 8:38 am
Hi, Thanks for writing the library. Are there any pointers for how to use it? I’m new to AS3/Flash/Flex and even a short explanation would be very useful.
February 19, 2009 at 1:38 pm
Hi Sujit! We are waiting for a sample about your great library!!!!
I’ve tried to use it into a Flex app but i get only security errors…
February 19, 2009 at 9:00 pm
[...] as3googlecalendarlib documentation | Not finding much time to work on the as3googlecalendarlib (http://sujitreddyg.wordpress.com/2009/01/29/as3-library-for-google-calendar-as3googlecalendarlib/) or the sample application using the library. I managed to create a simple API documentation for [...]
February 19, 2009 at 9:45 pm
Hi Sujit.
The error is:
RPC Fault – Security Error accessing url – Channel.security.error – Destination: DefaultHTTP
February 20, 2009 at 1:58 pm
Hi all,
I posted API docs and code samples for this library. More details at the URL below. This library might not work with Flex application running on Flash Player on browsers, cause Authenticate headers are blocked by Flash Players unless domain (Google in this case) has a cross domain policy which allows Authenticate headers. Please develop AIR applications. AIR rocks
http://sujitreddyg.wordpress.com/2009/02/19/documentation-for-as3googlecalendarlib/
Thanks.
February 20, 2009 at 2:00 pm
Hi Paolo,
This error shouldn’t be caused by this library. Please share the code to reproduce this. Send it to sujitreddy.g@gmail.com
Thanks.
February 22, 2009 at 6:01 am
hi..
when i try to add event to calendar(i try and when create new calendar, and when i try to load old) this error message
Error #2032: Stream Error. URL: http://www.google.com/calendar/feeds/default/owncalendars/full
Can you help me ?
farko.p@gmail.com
February 24, 2009 at 8:00 pm
Hi Fahrudin,
Please run the application in debug mode and find HTTP status code in the console and share that. I couldn’t understand what you are trying to do, please try sending the code to reproduce this to sujitreddy.g@gmail.com.
Thank you.
March 24, 2009 at 12:07 pm
hi,
I’m getting same error. HTTP status code is 403.
March 24, 2009 at 12:08 pm
INFORMATION : Sending authentication request
INFORMATION : Authentication request sent
INFORMATION : Authentication response recieved
INFORMATION : Parsed response
INFORMATION : Authentication successful
DEBUG : Add calendar XML created
DEBUG : Sent request to add calendar to this URL: http://www.google.com/calendar/feeds/default/owncalendars/full
INFORMATION : Authentication response event dispatched
DEBUG : HTTPStatus event for adding calendar invoked: 403
DEBUG : Fault function of add calendar invokedError #2032: Stream Error. URL: http://www.google.com/calendar/feeds/default/owncalendars/full
DEBUG : Dispatched GoogleCalendarServiceEvent.ADD_CALENDAR_FAULT event
March 25, 2009 at 11:47 pm
Hi all,
how do you use the authentication method? I can’t do it. I’ve generated an API key, and an OAuth Consumer Secret for the webpage, but when I try to run the code I get only this:
INFORMATION : Sending authentication request
INFORMATION : Authentication request sent
DEBUG : Add calendar XML created
DEBUG : Sent request to add calendar to this URL: http://www.google.com/calendar/feeds/default/owncalendars/full
and than the creationComplete tells me that: source not found and a button to edit the lookup source and than it tells me something like sandbox security error:
Error #2044: securityError unverarbeitet. text=Error #2170: Verletzung der Sicherheits-Sandbox: file:///Flex Builder 3/…/bin-debug/main.swf kann keine HTTP-Header an http://www.google.com/calendar/feeds/default/owncalendars/full senden.
Here is the code taken from the code samples:
public function onLoad():void
{
var calendar:GoogleCalendarVO = new GoogleCalendarVO();
calendar.setTitle(“test”);
calendar.setSummary(“calendar summary”);
calendar.timeZone = “Europe/Vienna”; //only few are supported. Check GoogleCalendarVO class
calendar.color = “#A32929″;
calendar.hidden = false;
calendar.addWhere(“Vienna”);
var _authenticate:GoogleCalendarAuthenticator = new GoogleCalendarAuthenticator();
_authenticate.addEventListener(GoogleCalendarAuthenticatorEvent.AUTHENTICATION_RESPONSE, doCalendar);
_authenticate.addEventListener(GoogleCalendarAuthenticatorEvent.AUTHENTICATION_FAULT, errorEvent);
_authenticate.authenticateUser(“user”, “pwd”, “API-key”);
var _calendarService:GoogleCalendarService = new GoogleCalendarService();
_calendarService.addEventListener(GoogleCalendarServiceEvent.ADD_CALENDAR_FAULT,handleAddCalendar);
_calendarService.addEventListener(GoogleCalendarServiceEvent.ADD_CALENDAR_RESPONSE,handleAddCalendar);
var user:GoogleCalendarUserVO = new GoogleCalendarUserVO();
user.userName = “user”;
user.userPassword = “pwd”;
user.authenticationToken =”Token taken from the oath-authentication when testing on google”;
var cal:GoogleCalendarVO = new GoogleCalendarVO();
if(cal != null)
{
_calendarService.addCalendar(cal, user);
}
}
what am I doing rong?
please help.
Thank you.
jimmi4u
March 26, 2009 at 4:04 pm
hi,
i’m using this project in an air application.
it authenticates successfully but when adding the calendar i get the following error:
DEBUG : HTTPStatus event for adding calendar invoked: 403
DEBUG : Fault function of add calendar invokedError #2032: Stream Error. URL: http://www.google.com/calendar/feeds/default/owncalendars/full
DEBUG : Dispatched GoogleCalendarServiceEvent.ADD_CALENDAR_FAULT event
March 26, 2009 at 9:15 pm
Hi Sudhir,
Google calendar server is throwing this error when a API is invoked for a first time from a system. I haven’t found anything fault in the library, still trying to figure out reason for this. Kindly let me know if this problem is occurring every time.
Hope this helps.
March 26, 2009 at 9:32 pm
Hi Jimmi,
Please find below sample on how to send authentication request.
Sending authentication request.
calendarAuthenticator.addEventListener(GoogleCalendarAuthenticatorEvent.AUTHENTICATION_RESPONSE,
handleAuthenticationResponse);
calendarAuthenticator.addEventListener(GoogleCalendarAuthenticatorEvent.AUTHENTICATION_FAULT,
handleAuthenticationResponse);
calendarAuthenticator.authenticateUser(userName,userPassword);
Getting authenticated GoogleCalendarUserVO object. You should use the authenticationToken in the object instance below.
private function handleAuthenticationResponse(event:GoogleCalendarAuthenticatorEvent):void
{
var userObj:GoogleCalendarUserVO;
userObj = event.authenticatedUser;
}
Hope this helps.
I am sorry I cannot find time to document.
March 31, 2009 at 1:42 pm
yes this error happens everytime. can’t find any problem with the code
May 18, 2009 at 3:16 pm
Hi all!
I want to use this library and want to know how.
Thank you
June 29, 2009 at 12:47 pm
is there any sample project posted??
thanks
Gireesh
July 21, 2009 at 6:16 pm
Is your lib not working with Flash AS3.0?
July 30, 2009 at 11:58 am
Hi,
I am facing problem while retrieving events for a single day. the request doesn’t return anything in the response. But in case I change the duration from a single day to a month, then all those events are shown. Any idea where I might b wrong?
Thanks
August 14, 2009 at 12:30 pm
Hi,
I am facing problem whiel updating the event.
from flash app to googlecalendar API. problem is
i am updating the event as googlecalendareventvo
in that
what,when,where,calendar,descrition are the fields to update. but when i pass startdatetime and enddatetime to when i am getting error like null object reference.
pls let me know if u have idea how to update event in calendar using flash as3
August 25, 2009 at 8:09 pm
It is not working for simple flash app. I think that need google cal webased authentication. Any Idea to implement it in flash.
August 28, 2009 at 6:26 pm
Hi Rahul,
Not sure. Please try sharing the code to reproduce this. I can see if I can find the problem. Thanks.
September 1, 2009 at 4:45 pm
Can you please modify this API for flash , now it is working only for AIR app.
Thanks in advance.
September 7, 2009 at 6:33 pm
Hi I Singh,
I don’t think Google has crossdomain policy files on their servers yet.
September 16, 2009 at 1:17 pm
Any other solution for it.
September 29, 2009 at 11:35 am
Hi. I’m running your code in an AIR application. When I run the authentication, the response comes back twice. The only listener involved is the following:
“var token:AsyncToken = authenticationService.send(params);
token.addResponder(new Responder(handleAuthenticationResult, handleAuthenticationFault));”
Is there a reason why the response handler is firing twice? The send() call is not duplicated anywhere, so I’m kinda lost on this one…
September 29, 2009 at 11:38 am
GOT IT..
appears to be a bug in 3.4
apparently it’s been fixed for 3.5
October 1, 2009 at 9:49 pm
Hi
I want to use this library. May I have a copy? Thank you