Google Apps Platform

Google Calendar API Version 3.0 Migration Guide

Contents

Introduction

This document is intended for developers that are already familiar with v2 of the Google Calendar API and who want to migrate to v3.

This guide assumes that you are already familiar with the new concepts introduced by v3 and have read the Get Started and API Reference.

Migrating resources

v3 of the Google Calendar API is built on Google's new APIs infrastructure which makes it backward incompatible with older versions built on top of the Google Data Protocol.

More information about v3 resources can be found in the API Reference.

Migrating event resources

The event kind entry from v2 has been moved to the event resource in v3.

The following tables map the v2 event kind's sub-elements to their corresponding event resource attributes for the supported programming languages.

Protocol

v2 v3
  • <atom:entry>
  •   <atom:author>
        <atom:name>displayName</atom:name>
        <atom:email>email</atom:email>
      </atom:author>
  •   <atom:id>
        http://www.google.com/calendar/feeds/calendarId/events/eventId
      </atom:id>
  •   <atom:updated>updatedDateTime</atom:updated>
  •   <atom:category scheme="http://schemas.google.com/g/2005#kind"
        term="http://schemas.google.com/g/2005#event"/>
  •   <atom:content>description</atom:content>
  •   <atom:link rel="alternate" type="text/html" href="htmlLink"/>
  •   <atom:title>title</atom:title>
  •   <gd:comments>
        <gd:feedLink href="commentsFeedLink"/>
      </gd:comments>
  •   <gd:eventStatus value="eventStatus"/>
  •   <!-- ... -->
      <gd:extendedProperty name="name" value="value"/>
      <!-- ... -->
  •   <gd:originalEvent href="originalEventAtomId"
          id="originalEventId">
        <gd:when startTime="originalStartTime"/>
      </gd:originalEvent>
  •   <gd:recurrence>
        DTSTART;dtStart
        DTEND;dtEnd
        RRULE
      </gd:recurrence>
  •   <gd:transparency
          value="http://schemas.google.com/g/2005#event.transparency"/>
  •   <gd:visibility
          value="http://schemas.google.com/g/2005#event.visibility"/>
  •   <!-- All day event  -->
      <gd:when startTime="startDate" endTime="endDate">
        <gCal:displayTimezone
            start="startTimeZone" end="endTimeZone"/>
      </gd:when>
      <!-- Event that takes place in a specific point in time  -->
      <gd:when startTime="startTime" endTime="endTime">
        <gCal:displayTimezone
            start="startTimeZone" end="endTimeZone"/>
      </gd:when>
  •   <!-- <gd:when startTime="startTime" endTime="endTime"> -->
        <gd:reminder method="reminderMethod"
            minutes="minutes"/>
      <!-- </gd:when> -->
  •   <gd:where valueString="location" />
  •   <gd:who email="attendeeEmail"
          rel="http://schemas.google.com/g/2005#event.attendee"
          valueString="displayName">
        <gd:attendeeStatus
            value="http://schemas.google.com/g/2005#event.attendeeStatus"/>
        <gd:attendeeType value="attendeeType"/>
      </gd:who>
  •   <gCal:sequence value="sequence" />
  •   <gCal:uid value="uid" />
  •   <atom:link rel="http://schemas.google.com/gCal/2005/webContent"
          href="gadgetIcon"
          title="gadgetTitle"
          type="gadgetType">
        <gCal:webContent url="gadgetURL"
            width="gadgetWidth" height="gadgetHeight">
          <gCal:webContentGadgetPref name="preferenceKey"
            value="preferenceValue" />
        <gCal:webContent>
      </atom:link>
  •   <gCal:guestsCanModify value="guestsCanModify" />
  •   <gCal:guestsCanInviteOthers value="guestsCanInviteOthers"/>
  •   <gCal:guestsCanSeeGuests value="guestsCanSeeGuests"/>
  • </atom:entry>

Java

v2 v3
  • // Create a new event.
    CalendarEventEntry event = new CalendarEventEntry();
    // ...
    
  • // Retrieve the event author.
    String authorDisplayName = event.getAuthors().get(0).getName();
    String email =
    event.getAuthors().get(0).getEmail();
    
  • // Retrieve the event ID.
    String atomId = event.getId();
    String id = atomId.substring(atomId.lastIndexOf("/") + 1);
    
  • // Retrieve the published date and time.
    DateTime published = event.getPublished();
    
  • // Retrieve the updated date and time.
    DateTime updated = event.getUpdated();
    
  • // Retrieve the event kind.
    String kind = event.getKind();
    
  • // Retrieve the event description.
    String description = event.getPlainTextContent();
    
  • // Retrieve the event link.
    String htmlLink = event.getHtmlLink().getHref();
    
  • // Retrieve the event title.
    String title = event.getTitle().getPlainText();
    
  • // Retrieve the event status.
    String eventStatus = event.getStatus().getValue();
    
  • // Retrieve the event properties.
    for (ExtendedProperty property :
             event.getExtendedProperty()) {
      String name = property.getName();
      String value = property.getValue();
    }
    
  • // Retrieve the ID of the recurring event and the original
    // start time of the current instance.
    String originalEventId = event.getOriginalEvent().getOriginalId();
    DateTime originalStartTime =
         event.getOriginalEvent().getOriginalStartTime()
             .getStartTime();
    
  • // Retrieve the event recurrence.
    // The recurrence element contains various values that
    // are not used in Calendar v3 such as DTSTART
    // and DTEND
    String recurrence = event.getRecurrence().getValue();
    
  • // Retrieve the event transparency.
    String v2transparency = event.getTransparency().getValue();
    String transparency =
        v2transparency.substring(
            v2transparency.lastIndexOf(".") + 1);
    
  • // Retrieve the event visibility.
    String v2visibility = event.getVisibility().getValue();
    String visibility =
        v2visibility.substring(v2visibility.lastIndexOf(".") + 1);
    
  • // Retrieve the event start and end times.
    When when = event.getTimes().get(0);
    DateTime start = when.getStartTime();
    DateTime end = when.getEndTime();
    
  • // Retrieve the event reminders.
    for (Reminder reminder : event.getReminders()) {
      String reminderMethod = reminder.getMethod();
      int minutes = reminder.getMinutes();
    }
    
  • // Retrieve the event location.
    String location = event.getLocations().get(0).getValueString();
    
  • // Retrieve the event attendees.
    for (EventWho attendee : event.getParticipants()) {
      String displayName = attendee.getValueString();
      String attendeeEmail = attendee.getEmail();
      String v2status = attendee.getAttendeeStatus();
      String attendeeStatus =
          v2status.substring(v2status.getLastIndexOf(".") + 1);
      String attendeeType = attendee.getAttendeeType();
    }
    
  • // Retrieve the event sequence.
    int sequence = event.getSequence();
    
  • // Retrieve the event iCal UID.
    String uid = event.getIcalUID();
    
  • // Retrieve an event gadget.
    WebContent gadget = event.getWebContent();
    
    String gadgetIcon = gadget.getIcon();
    String gadgetTitle = gadget.getTitle();
    String gadgetType = gadget.getType();
    String gadgetURL = gadget.getUrl();
    String gadgetWidth = gadget.getWidth();
    String gadgetHeight = gadget.getHeight();
    
    for (Map.Entry<String, String> gadgetPreference :
             gadget.getGadgetPrefs()) {
      String preferenceKey = gadgetPreference.getKey();
      String preferenceValue = gadgetPreference.getValue();
    }
    
  • // Retrieve whether or not guests can modify the event.
    boolean guestsCanModify = event.isGuestsCanModify();
    
  • // Retrieve whether or not guests can invite others.
    boolean guestsCanInviteOthers = event.isGuestsCanInviteOthers();
    
  • // Retrieve whether or not guests can see others.
    boolean guestsCanSeeGuests = event.isGuestsCanSeeGuests();
    
  • // Create a new event.
    Event event = new Event();
    // ...
    
  • // Retrieve the event author.
    String authorDisplayName =
        event.getCreator().getDisplayName();
    String email = event.getCreator().getEmail();
    
  • // Retrieve the event ID.
    String id = event.getId();
    
  • // Retrieve the event published date and time.
    DateTime published = event.getPublished();
    
  • // Retrieve the event updated date and time.
    DateTime updated = event.getUpdated();
    
  • // Retrieve the event kind.
    String kind = event.getKind();
    
  • // Retrieve the event description.
    String description = event.getDescription();
    
  • // Retrieve the event link.
    String htmlLink = event.getHtmlLink();
    
  • // Retrieve the event title.
    String title = event.getSummary();
    
  • // Retrieve the event status.
    String eventStatus = event.getStatus();
    
  • // Retrieve the event properties.
    for (Map.Entry<String, String> sharedProperty :
             event.getExtendedProperties.getShared()) {
      String sharedName = sharedProperty.getKey();
      String sharedValue = sharedProperty.getValue();
    }
    for (Map.Entry<String, String> privateProperty :
             event.getExtendedProperties
                 .getCalendarPrivate()) {
      String privateName = privateProperty.getKey();
      String privateValue = privateProperty.getValue();
    }
    
  • // Retrieve the ID of the recurring event and the
    // original start time of the current instance.
    String originalEventId = event.getRecurringEventId();
    String originalStartTime = event.getOriginalStartTime();
    
  • // Retrieve the event recurrence.
    // The recurrence element contains a list of strings
    // representing an RFC 2445 RRULE, EXRULE, RDATE
    // or EXDATE rule.
    List recurrence = event.getRecurrence();
    
  • // Retrieve the event transparency.
    String transparency = event.getTransparency();
    
  • // Retrieve the event visibility.
    String visibility = event.getVisibility();
    
  • // Retrieve the event start and end times.
    EventDateTime start = event.getStart();
    EventDateTime end = event.getEnd();
    
  • // Retrieve the event reminders.
    for (EventReminder reminder : event.getReminders()) {
      String reminderMethod = reminder.getMethod();
      int minutes = reminder.getMinutes();
    }
    
  • // Retrieve the event location.
    String location = event.getLocation();
    
  • // Retrieve the event attendees.
    for (EventAttendee attendee : event.getAttendees()) {
      String attendeeEmail = attendee.geEmail();
      String displayName = attendee.getDisplayName();
      String attendeeStatus = attendee.getResponseStatus();
      boolean isSelf = attendee.getSelf();
      boolean isOrganizer = attendee.getOrganizer();
    }
    
  • // Retrieve the event sequence.
    int sequence = event.getSequence();
    
  • // Retrieve the event iCal UID.
    String uid = event.getICalUID();
    
  • // Retrieve an event gadget.
    EventGadget gadget = event.getGadget();
    
    String gadgetIcon = gadget.getIcon();
    String gadgetTitle = gadget.getTitle();
    String gadgetType = gadget.getType();
    String gadgetURL = gadget.getLink();
    String gadgetWidth = gadget.getWidth();
    String gadgetHeight = gadget.getHeight();
    
    for (Map.Entry<String, String> gadgetPreference :
             gadget.getPreferences()) {
      String preferenceKey = gadgetPreference.getKey();
      String preferenceValue = gadgetPreference.getValue();
    }
    
  • // Retrieve whether or not guests can modify the event.
    boolean guestsCanModify = event.getGuestsCanModify();
    
  • // Retrieve whether or not guests can invite others.
    boolean guestsCanInviteOthers =
        event.getGuestsCanInviteOthers();
    
  • // Retrieve whether or not guests can see others.
    boolean guestsCanSeeGuests =
        event.getGuestsCanSeeOtherGuests();
    

Python

v2 v3
  • # Create a new event.
    event = gdata.calendar.data.CalendarEventEntry();
    # ...
    
  • # Retrieve the event author.
    author_display_name = event.author[0].name
    email = event.author[0].email
    
  • # Retrieve the event ID.
    atom_id = event.id.text
    id = atom_id.split('/')[-1]
    
  • # Retrieve the published date and time.
    published = event.published.text
    
  • # Retrieve the updated date and time.
    updated = event.updated.text
    
  • # Retrieve the event kind.
    kind = event.kind.text
    
  • # Retrieve the event description
    description = event.content.text
    
  • # Retrieve the event link.
    html_link = event.find_alternate_link()
    
  • # Retrieve the event title.
    title = event.title.text
    
  • # Retrieve the event status.
    event_status = event.event_status.value
    
  • # Retrieve the event properties.
    for property in event.extended_property:
      name = property.name
      value = property.value
    
  • # Retrieve the ID of the recurring event and the original
    # start time of the current instance.
    original_event_id = event.original_event.id
    original_start_time = event.original_event.when.start
    
  • # Retrieve the event recurrence.
    # The recurrence element contains various values that
    # are not used in Calendar v3 such as DTSTART
    # and DTEND
    recurrence = event.recurrence.value
    
  • # Retrieve the event transparency.
    v2transparency = event.transparency.value
    transparency =
        v2transparency.split('.')[-1]
    
  • # Retrieve the event visibility.
    v2visibility = event.visibility.value
    visibility = v2visibility.split('.')[-1]
    
  • # Retrieve the event start and end times.
    when = event.when[0]
    start = when.start
    end = when.end
    
  • # Retrieve the event reminders.
    for reminder in event.when[0].reminder:
      reminder_method = reminder.method
      minutes = reminder.minutes
    
  • # Retrieve the event location.
    location = event.where[0].value
    
  • # Retrieve the event attendees.
    for attendee in event.who:
      display_name = attendee.value
      attendee_email = attendee.email
      v2status = attendee.attendee_status
      attendee_status = v2status.split('.')[-1]
      attendee_type = attendee.attendee_type
    
  • # Retrieve the event sequence.
    sequence = event.sequence.value
    
  • # Retrieve the event iCal UID.
    uid = event.uid.value
    
  • # Retrieve an event gadget.
    gadget = event.get_link(
        gdata.calendar.data.WEB_CONTENT_LINK_REL)
    gadget_icon = gadget.href
    gadget_title = gadget.title
    gadget_type = gadget.type
    gadget_url = gadget.web_content.url
    gadget_width = gadget.web_content.width
    gadget_height = gadget.web_content.height
    for gadget_preference in (
        gadget.web_content.web_content_gadget_pref):
      preference_key = gadget_preference.name
      preference_value = gadget_preference.value
    
  • # Retrieve whether or not guests can modify the event.
    guests_can_modify = event.guests_can_modify.value
    
  • # Retrieve whether or not guests can invite others.
    guests_can_invite_others = event.guests_can_invite_others.value
    
  • # Retrieve whether or not guests can see others.
    guests_can_see_guests = event.guests_can_see_guests.value
    
  • # Create a new event.
    event = {}
    # ...
    
  • # Retrieve the event author.
    author_display_name = event['creator']['displayName']
    email = event['creator']['email']
    
  • # Retrieve the event ID.
    id = event['id']
    
  • # Retrieve the event published date and time.
    published = event['published']
    
  • # Retrieve the event updated date and time.
    updated = event['updated']
    
  • # Retrieve the event kind.
    kind = event['kind']
    
  • # Retrieve the event description.
    description = event['description']
    
  • # Retrieve the event link.
    htmlLink = event['htmlLink']
    
  • # Retrieve the event title.
    title = event['summary']
    
  • # Retrieve the event status.
    event_status = event['status']
    
  • # Retrieve the event properties.
    for shared_property in (
        event['extendedProperties']['shared'].iteritems()):
      shared_name = shared_property[0]
      shared_value = shared_property[1]
    for private_property in (
        event['extendedProperties']['private'].iteritems()):
      private_name = private_property[0]
      private_value = private_property[1]
    
  • # Retrieve the ID of the recurring event and the original
    # start time of the current instance.
    original_event_id = event['recurringEventId']
    original_start_time = event['originalStartTime']
    
  • # Retrieve the event recurrence.
    # The recurrence element contains a list of string
    # representing an RFC 2445 RRULE, EXRULE, RDATE
    # or EXDATE rule.
    recurrence = event['recurrence']
    
  • # Retrieve the event transparency.
    transparency = event['transparency']
    
  • # Retrieve the event visibility.
    visibility = event['visibility']
    
  • # Retrieve the event start and end times.
    start = event['start']
    end = event['end']
    
  • # Retrieve the event reminders.
    for reminder in event['reminders']:
      reminder_method = reminder['method']
      minutes = reminder['minutes']
    
  • # Retrieve the event location.
    location = event['location']
    
  • # Retrieve the event attendees.
    for attendee : event['attendees']:
      attendee_email = attendee['email']
      display_name = attendee['displayName']
      attendee_status = attendee['responseStatus']
      is_self = attendee['self']
      is_organizer = attendee['organizer']
    
  • # Retrieve the event sequence.
    sequence = event['sequence']
    
  • # Retrieve the event iCal UID.
    uid = event['iCalUID']
    
  • # Retrieve an event gadget.
    gadget = event['gadget']
    gadget_icon = gadget['icon']
    gadget_title = gadget['title']
    gadget_type = gadget['type']
    gadget_url = gadget['link']
    gadget_width = gadget['width']
    gadget_height = gadget['height']
    for gadget_preference in gadget['preferences'].iteritems():
      preference_key = gadget_preference[0]
      preference_value = gadget_preference[1]
    
  • # Retrieve whether or not guests can modify the event.
    guests_can_modify = event['guestsCanModify']
    
  • # Retrieve whether or not guests can invite others.
    guests_can_invite_others = event['guestsCanInviteOthers']
    
  • # Retrieve whether or not guests can see others.
    guests_can_see_guests = event['guestsCanSeeOtherGuests']
    

.NET

v2 v3
  • // Create a new event.
    EventEntry event = new EventEntry();
    // ...
    
  • // Retrieve the event author.
    String authorDisplayName = event.Author[0].Name;
    String email = event.Authors[0].Email;
    
  • // Retrieve the event ID.
    String atomId = event.Id.AbsoluteUri;
    String id = atomId.Substring(id.LastIndexOf("/") + 1);
    
  • // Retrieve the published date and time.
    DateTime published = event.Published;
    
  • // Retrieve the updated date and time.
    DateTime updated = event.Updated;
    
  • // Retrieve the event description.
    String description = event.Content.Content;
    
  • // Retrieve the event link.
    String htmlLink = event.AlternateUri.Content;
    
  • // Retrieve the event title.
    String title = event.Title.Text;
    
  • // Retrieve the event status.
    String eventStatus = event.Status.Value;
    
  • // Retrieve the event properties.
    foreach (ExtendedProperty property in
                 event.ExtensionElements) {
      String name = property.Name;
      String value = property.Value;
    }
    
  • // Retrieve the ID of the recurring event and the original
    // start time of the current instance.
    String originalEventId = event.OriginalEvent.IdOriginal;
    DateTime originalStartTime =
         event.OriginalEvent.OriginalStartTime.StartTime;
    
  • // Retrieve the event recurrence.
    // The recurrence element contains various values that
    // are not used in Calendar v3 such as DTSTART
    // and DTEND
    String recurrence = event.Recurrence.Value;
    
  • // Retrieve the event transparency.
    String v2transparency = event.EventTransparency.Value;
    String transparency =
        v2transparency.Substring(
            v2transparency.LastIndexOf(".") + 1);
    
  • // Retrieve the event visibility.
    String v2visibility = event.EventVisibility.Value;
    String visibility =
        v2visibility.Substring(v2visibility.LastIndexOf(".") + 1);
    
  • // Retrieve the event start and end times.
    When when = event.Times[0];
    DateTime start = event.StartTime;
    DateTime end = event.EndTime;
    
  • // Retrieve the event reminders.
    foreach (Reminder reminder in event.Reminders) {
      String reminderMethod = reminder.Method;
      int minutes = reminder.Minutes;
    }
    
  • // Retrieve the event location.
    String location = event.Locations[0].ValueString;
    
  • // Retrieve the event attendees.
    foreach (Who attendee in event.Participants) {
      String displayName = attendee.ValueString;
      String attendeeEmail = attendee.Email;
      String v2status = attendee.Attendee_Status;
      String attendeeStatus =
          v2status.Substring(v2status.getLastIndexOf(".") + 1);
      String attendeeType = attendee.Attendee_Type;
    }
    
  • // Retrieve the event sequence.
    int sequence = event.Sequence.Value;
    
  • // Retrieve the event iCal UID.
    String uid = event.Uid.Value;
    
  • // Retrieve an event gadget.
    WebContentLink gadget = event.WebContentLink;
    
    String gadgetIcon = gadget.Icon;
    String gadgetTitle = gadget.Title;
    String gadgetType = gadget.Type;
    String gadgetURL = gadget.Url;
    String gadgetWidth = gadget.Width;
    String gadgetHeight = gadget.Height;
    
    foreach (KeyValuePair<String, String> gadgetPreference in
             gadget.GadgetPreferences) {
      String preferenceKey = gadgetPreference.Key;
      String preferenceValue = gadgetPreference.Value;
    }
    
  • // The gContact:guestsCanModify element was not
    // available in the GData client library.
    
  • // The gContact:guestsCanInviteOthers element was not
    // available in the GData client library.
    
  • // The gContact:guestsCanSeeGuests element was not
    // available in the GData client library.
    
  • // Create a new event.
    Event event = new Event();
    // ...
    
  • // Retrieve the event author.
    String authorDisplayName = event.Creator.DisplayName;
    String email = event.Creator.Email;
    
  • // Retrieve the event ID.
    String id = event.Id;
    
  • // Retrieve the published date and time.
    DateTime published = event.Published;
    
  • // Retrieve the updated date and time.
    DateTime updated = event.Updated;
    
  • // Retrieve the event description.
    String description = event.Description;
    
  • // Retrieve the event link.
    String htmlLink = event.HtmlLink;
    
  • // Retrieve the event summary.
    String title = event.Summary;
    
  • // Retrieve the event status.
    String eventStatus = event.Status;
    
  • // Retrieve the event properties.
    foreach (KeyValuePair<String, String> sharedProperty in
             event.getExtendedProperties.Shared) {
      String sharedName = sharedProperty.Key;
      String sharedValue = sharedProperty.Value;
    }
    foreach (KeyValuePair<String, String> privateProperty in
             event.getExtendedProperties
                 .CalendarPrivate) {
      String privateName = privateProperty.Key;
      String privateValue = privateProperty.Value;
    }
    
  • // Retrieve the ID of the recurring event and the original
    // start time of the current instance.
    String originalEventId = event.RecurringEventId;
    String originalStartTime = event.OriginalStartTime;
    
  • // Retrieve the event recurrence.
    // The recurrence element contains a list of string
    // representing an RFC 2445 RRULE, EXRULE, RDATE
    // or EXDATE rule.
    IList recurrence = event.Recurrence;
    
  • // Retrieve the event transparency.
    String transparency = event.Transparency;
    
  • // Retrieve the event visibility.
    String visibility = event.Visibility;
    
  • // Retrieve the event start and end times.
    EventDateTime start = event.Start;
    EventDateTime end = event.End;
    
  • // Retrieve the event reminders.
    foreach (EventReminder reminder in event.Reminders) {
      String reminderMethod = reminder.Method;
      int minutes = reminder.Minutes;
    }
    
  • // Retrieve the event location.
    String location = event.Location;
    
  • // Retrieve the event attendees.
    foreach (EventAttendee attendee in event.Attendees) {
      String attendeeEmail = attendee.Email;
      String displayName = attendee.DisplayName;
      String attendeeStatus = attendee.ResponseStatus;
      bool isSelf = attendee.Self;
      bool isOrganizer = attendee.Organizer;
    }
    
  • // Retrieve the event sequence.
    int sequence = event.Sequence;
    
  • // Retrieve the event iCal UID.
    String uid = event.ICalUID;
    
  • // Retrieve an event gadget.
    EventGadget gadget = event.Gadget;
    
    String gadgetIcon = gadget.Icon;
    String gadgetTitle = gadget.Title;
    String gadgetType = gadget.Type;
    String gadgetURL = gadget.Link;
    String gadgetWidth = gadget.Width;
    String gadgetHeight = gadget.Height;
    
    foreach (KeyValuePair<String, String> gadgetPreference in
             gadget.Preferences) {
      String preferenceKey = gadgetPreference.Key;
      String preferenceValue = gadgetPreference.Value;
    }
    
  • // Retrieve whether or not guests can modify the event.
    bool guestsCanModify = event.GuestsCanModify;
    
  • // Retrieve whether or not guests can invite others.
    bool guestsCanInviteOthers =
        event.GuestsCanInviteOthers;
    
  • // Retrieve whether or not guests can see others.
    bool guestsCanSeeGuests =
        event.GuestsCanSeeOtherGuests;
    

Migrating calendar resources

The v2 calendar entry has been split into two separate resources in v3:

  • Calendar Entry — Holds information about the calendar entry that is shared among other users (summary, description, etc).
  • CalendarList Entry — Holds information about the calendar for a specific user (color, overriden summary, description, etc).

The following tables map the calendar entry sub-elements to their corresponding calendar resource attributes when available.

Protocol

v2 v3
  • <atom:entry gd:etag="calendarEtag"
           gd:kind="calendar#calendar">
  •   <atom:id>
        http://www.google.com/calendar/feeds/default/calendars/calendarId
      </atom:id>
  •   <atom:published>published</atom:published>
  •   <atom:updated>updated</atom:updated>
  •   <atom:title type="text">title</atom:title>
  •   <summary type="text">description</summary>
  •   <atom:author>
        <atom:name>authorDisplayName</atom:name>
        <atom:email>authorEmail</atom:email>
      </atom:author>
  •   <gd:where valueString="location"></gd:where>
  •   <gCal:timezone value="timeZone"/>
  •   <gCal:accesslevel value="accessLevel"/>
  •   <gCal:color value="color"/>
  •   <gCal:hidden value="isHidden"/>
  •   <gCal:selected value="isSelected"/>
  •   <gCal:timesCleaned value="timesCleaned"/>
  • </atom:entry>
  • {
      "etag": "calendarEtag",
      "kind": "calendar#calendar",
  •   "id": "calendarId",
  • # * Published date and time are not available in v3.
  • # * Updated date and time are not available in v3.
  •   "summary": "title",
  •   "description": "description",
  • # * Calendar's author is not available in v3.
  •   "location": "location",
  •   "timeZone": "timeZone",
  • # * The Access Level information has been moved
    #   to the CalendarListEntry resource.
    
  • # * Color has been moved to the CalendarListEntry
    #   resource.
    
  • # * Whether or not this calendar is hidden has been
    #   moved to the CalendarListEntry resource.
    
  • # * Whether or not this calendar is selected has been
    #   moved to the CalendarListEntry resource.
    
  • # * The number of times the calendar has been cleaned
    #   is not available in Calendar v3.
    
  • }

Java

v2 v3
  • // Create a new calendar.
    CalendarEntry calendar = new CalendarEntry();
    // ...
    
  • // Retrieve the calendar Etag.
    String etag = calendar.getEtag();
    
  • // Retrieve the calendar kind.
    String kind = calendar.getKind();
    
  • // Retrieve the calendar ID.
    String atomId = calendar.getId();
    String id = atomId.substring(atomId.lastIndexOf("/") + 1);
    
  • // Retrieve the published date and time.
    DateTime published = calendar.getPublished();
    
  • // Retrieve the updated date and time.
    DateTime updated = calendar.getUpdated();
    
  • // Retrieve the calendar title.
    String title = calendar.getTitle().getPlainText();
    
  • // Retrieve the calendar description.
    String description = calendar.getSummary().getPlainText();
    
  • // Retrieve the calendar author.
    Author author = calendar.getAuthors().get(0);
    
  • // Retrieve the calendar location.
    String location = calendar.getLocations().get(0).getValueString();
    
  • // Retrieve the calendar time zone.
    String timeZone = calendar.getTimeZone().getValue();
    
  • // Retrieve the calendar access level.
    String accessLevel = calendar.getAccessLevel().getValue();
    
  • // Retrieve the calendar color.
    String color = calendar.getColor().getValue();
    
  • // Retrieve whether or not the calendar is hidden.
    String isHidden = calendar.getHidden().getValue();
    
  • // Retrieve whether or not the calendar is selected.
    String isSelected = calendar.getSelected().getValue();
    
  • // Retrieve the number of times the calendar has been cleaned.
    int timesCleaned = calendar.getTimesCleaned().getValue();
    
  • // Create a new calendar.
    Calendar calendar = new Calendar();
    // ...
    
  • // Retrieve the calendar Etag.
    String etag = calendar.getEtag();
    
  • // Retrieve the calendar kind.
    String kind = calendar.getKind();
    
  • // Retrieve the calendar ID.
    String id = calendar.getId();
    
  • // Published date and time are not available in v3.
    
  • // Updated date and time are not available in v3.
    
  • // Retrieve the calendar title.
    String title = calendar.getSummary();
    
  • // Retrieve the calendar description.
    String description = calendar.getDescription();
    
  • // Calendar's author is not available in v3.
    
  • // Retrieve the calendar location.
    String location = calendar.getLocation();
    
  • // Retrieve the calendar time zone.
    String timeZone = calendar.getTimeZone();
    
  • // Access Level information has been moved to the
    // CalendarListEntry resource.
    
  • // Color has been moved to the CalendarListEntry
    // resource.
    
  • // Whether or not this calendar is hidden has been
    // moved to the CalendarListEntry resource.
    
  • // Whether or not this calendar is selected has been
    // moved to the CalendarListEntry resource.
    
  • // The number of times the calendar has been cleaned
    // is not available in Calendar v3.
    

Python

v2 v3
  • # Create a new calendar.
    calendar = gdata.calendar.data.CalendarEntry()
    # ...
    
  • # Retrieve the calendar Etag.
    etag = calendar.etag
    
  • # Retrieve the calendar kind.
    kind = calendar.kind
    
  • # Retrieve the calendar ID.
    atomId = calendar.id.text
    id = atomId.split('/')[-1]
    
  • # Retrieve the published date and time.
    published = calendar.published.text
    
  • # Retrieve the updated date and time.
    updated = calendar.updated.text
    
  • # Retrieve the calendar title.
    title = calendar.title.text
    
  • # Retrieve the calendar description.
    description = calendar.summary.text
    
  • # Retrieve the calendar author.
    author = calendar.author[0]
    
  • # Retrieve the calendar location.
    location = calendar.where[0].value
    
  • # Retrieve the calendar time zone.
    timeZone = calendar.timezone.value
    
  • # Retrieve the calendar access level.
    accessLevel = calendar.accesslevel.value
    
  • # Retrieve the calendar color.
    color = calendar.color.value
    
  • # Retrieve whether or not the calendar is hidden.
    isHidden = calendar.hidden.value
    
  • # Retrieve whether or not the calendar is selected.
    isSelected = calendar.selected.value
    
  • # Retrieve the number of times the calendar has been cleaned.
    timesCleaned = calendar.times_cleaned.value
    
  • # Create a new calendar.
    calendar = {}
    // ...
    
  • # Retrieve the calendar Etag.
    etag = calendar['etag']
    
  • # Retrieve the calendar kind.
    kind = calendar['kind']
    
  • # Retrieve the calendar ID.
    id = calendar['id']
    
  • # Published date and time are not available in v3.
    
  • # Updated date and time are not available in v3.
    
  • # Retrieve the calendar title.
    title = calendar['summary']
    
  • # Retrieve the calendar description.
    description = calendar['description']
    
  • # Calendar's author is not available in v3.
    
  • # Retrieve the calendar location.
    location = calendar['location']
    
  • # Retrieve the calendar time zone.
    timeZone = calendar['timeZone']
    
  • # The Access Level information has been moved
    # to the CalendarListEntry resource.
    
  • # Color has been moved to the CalendarListEntry
    # resource.
    
  • # Whether or not this calendar is hidden has been
    # moved to the CalendarListEntry resource.
    
  • # Whether or not this calendar is selected has been
    # moved to the CalendarListEntry resource.
    
  • # The number of times the calendar has been cleaned
    # is not available in Calendar v3.
    

.NET

v2 v3
  • // Create a new calendar.
    CalendarEntry calendar = new Calendar();
    // ...
    
  • // Retrieve the calendar Etag.
    String etag = calendar.Etag;
    
  • // Retrieve the calendar ID.
    String atomId = calendar.Id.AbsoluteUri;
    String id = atomId.SubString(atomId.LastIndexOf("/") + 1);
    
  • // Retrieve the published date and time.
    DateTime published = calendar.Published;
    
  • // Retrieve the updated date and time.
    DateTime updated = calendar.Updated;
    
  • // Retrieve the calendar title.
    String title = calendar.Title.Text;
    
  • // Retrieve the calendar description.
    String description = calendar.Summary.Text;
    
  • // Retrieve the calendar author.
    Author author = calendar.Authors[0];
    
  • // Retrieve the calendar location.
    String location = calendar.Location.ValueString;
    
  • // Retrieve the calendar time zone.
    String timeZone = calendar.TimeZone;
    
  • // Retrieve the calendar access level.
    String accessLevel = calendar.AccessLevel;
    
  • // Retrieve the calendar color.
    String color = calendar.Color;
    
  • // Retrieve whether or not the calendar is hidden.
    bool isHidden = calendar.Hidden;
    
  • // Retrieve whether or not the calendar is selected.
    bool isSelected = calendar.Selected;
    
  • // Create a new calendar.
    Calendar calendar = new Calendar();
    // ...
    
  • // Retrieve the calendar Etag.
    String etag = calendar.Etag;
    
  • // Retrieve the calendar ID.
    String id = calendar.Id;
    
  • // Published date and time are not available in v3.
    
  • // Updated date and time are not available in v3.
    
  • // Retrieve the calendar title.
    String title = calendar.Summary;
    
  • // Retrieve the calendar description.
    String description = calendar.Description;
    
  • // Calendar's author is not available in v3.
    
  • // Retrieve the calendar location.
    String location = calendar.Location;
    
  • // Retrieve the calendar time zone.
    String timeZone = calendar.TimeZone;
    
  • // Access Level information has been moved to the
    // CalendarListEntry resource.
    
  • // Color has been moved to the CalendarListEntry resource.
    
  • // Whether or not this calendar is hidden has been moved
    // to the CalendarListEntry resource.
    
  • // Whether or not this calendar is selected has been moved
    // to the CalendarListEntry resource.
    

Migrating ACL resources

v3 doesn't introduce big changes to an Access Control Rule entry other than using JSON as the data representation format.

The following tables map v2 Access Control Rule entry's sub-elements to their corresponding Access Control Rule resource attributes.

Protocol

v2 v3
  • <atom:entry gd:etag="etag"
        gd:kind="calendar#acl">
  •   <atom:id>http://www.google.com/calendar/feeds/calendarId/acl/aclId</atom:id>
  •   <gAcl:role value="http://schemas.google.com/gCal/2005#role"/>
  •   <gAcl:scope type="scopeType" value="scopeValue"/>
  • </entry>

Java

v2 v3
  • // Create a new ACL entry.
    AclEntry acl = new AclEntry();
    // ...
    
  • // Retrieve the ACL entry Etag.
    String etag = acl.getEtag();
    
  • // Retrieve the ACL entry kind.
    String kind = acl.getKind();
    
  • // Retrieve the ACL entry ID.
    String atomId = acl.getId();
    String id = atomId.substring(atomid.lastIndexOf("/") + 1);
    
  • // Retrieve the ACL entry role.
    String role = acl.getRole().getValue();
    
  • // Retrieve the ACL entry scope type.
    AclScope.Type scopeType = acl.getScope().getType();
    
  • // Retrieve the ACL entry scope value.
    String scopeValue = acl.getScope().getValue();
    
  • // Create a new ACL entry.
    AclRule acl = new AclRule();
    // ...
    
  • // Retrieve the ACL entry Etag.
    String etag = acl.getEtag();
    
  • // Retrieve the ACL entry kind.
    String kind = acl.getKind();
    
  • // Retrieve the ACL entry ID.
    String id = acl.getId();
    
  • // Retrieve the ACL entry role.
    String role = acl.getRole();
    
  • // Retrieve the ACL entry scope type.
    String scopeType = acl.getScope().getType();
    
  • // Retrieve the ACL entry scope value.
    String scopeValue = acl.getScope().getValue();
    

Python

v2 v3
  • # Create a new ACL entry.
    acl = gdata.calendar.data.CalendarAclEntry()
    # ...
    
  • # Retrieve the ACL entry Etag.
    etag = acl.etag
    
  • # Retrieve the ACL entry kind.
    kind = acl.kind
    
  • # Retrieve the ACL entry ID.
    atom_id = acl.id.text
    id = atom_id.split('/')[-1]
    
  • # Retrieve the ACL entry role.
    role = acl.role.value
    
  • # Retrieve the ACL entry scope type.
    scope_type = acl.scope.type
    
  • # Retrieve the ACL entry scope value.
    scope_value = acl.scope.value
    
  • # Create a new ACL entry.
    acl = {}
    # ...
    
  • # Retrieve the ACL entry Etag.
    etag = acl['etag']
    
  • # Retrieve the ACL entry kind.
    kind = acl['kind']
    
  • # Retrieve the ACL entry ID.
    id = acl['id']
    
  • # Retrieve the ACL entry role.
    role = acl['role']
    
  • # Retrieve the ACL entry scope type.
    scope_type = acl['scope']['type']
    
  • # Retrieve the ACL entry scope value.
    scope_value = acl['scope']['value']
    

.NET

v2 v3
  • // Create a new ACL entry.
    AclEntry acl = new AclEntry();
    // ...
    
  • // Retrieve the ACL entry Etag.
    String etag = acl.Etag;
    
  • // Retrieve the ACL entry ID.
    String atomId = acl.Id.AbsoluteUri;
    String id = atomId.SubString(atomId.LastIndexOf("/") + 1);
    
  • // Retrieve the ACL entry role.
    String role = acl.Role;
    
  • // Retrieve the ACL entry scope type.
    String scopeType = acl.Scope.Type;
    
  • // Retrieve the ACL entry scope value.
    String scopeValue = acl.Scope.Value;
    
  • // Create a new ACL entry.
    AclRule acl = new AclRule();
    // ...
    
  • // Retrieve the ACL entry Etag.
    String etag = acl.Etag;
    
  • // Retrieve the ACL entry ID.
    String id = acl.Id;
    
  • // Retrieve the ACL entry role.
    String role = acl.Role;
    
  • // Retrieve the ACL entry scope type.
    String scopeType = acl.Scope.Type;
    
  • // Retrieve the ACL entry scope value.
    String scopeValue = acl.Scope.Value;
    

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.