Calendar v3 API - event list request colorIds coming back as null

1,032 views
Skip to first unread message

James Dunne

unread,
Oct 3, 2012, 12:28:03 PM10/3/12
to google-ca...@googlegroups.com
As user A (e.g. us...@mydomain.edu), I create calendar A via the API.

In calendar A, I create an event and assign it an explicit colorId value (e.g. "9").

The event persists and I can see that the correct color is assigned within the Google Calendar UI.

I add calendar A to user B's (e.g. us...@mydomain.edu) calendar list.

When I fetch the event list (GET /calendar/v3/calendars/userB%40mydomain.edu/events) for user B's default calendar using xoauth_requestor_id=us...@mydomain.edu, all the colorIds for the events come back as null.

Context:
I'm working in a Google Apps for Education domain using OAuth 1.0 with the xoauth_requestor_id query-string parameter for authentication purposes.

James Dunne

unread,
Oct 12, 2012, 5:46:22 PM10/12/12
to google-ca...@googlegroups.com
Issue resolved.

The problem was that I was looking at a duplicate of the original event caused by adding the user as an attendee to the event. Apparently, colorIds are not duplicated with the rest of the event. This event duplication was causing issues anyway, so I cleared out the attendee list of the event, instead preferring to synchronize at the calendar level rather than the event level with the attendee list.

It also turns out that an event's colorId is useless when sharing a single calendar across many users. When a calendar is in your "Other Calendars" list, the per-user-per-calendar colorId takes precedence and the per-event colors on the owning user's calendar become meaningless in this circumstance. This is, naturally, completely undocumented.

On Wednesday, October 3, 2012 11:28:03 AM UTC-5, James Dunne wrote:
As user A (e.g. us...@mydomain.edu), I create calendar A via the API.

In calendar A, I create an event and assign it an explicit colorId value (e.g. "9").

The event persists and I can see that the correct color is assigned within the Google Calendar UI.

I add calendar A to user B's (e.g. us...@mydomain.edu) calendar list.

When I fetch the event list (GET /calendar/v3/calendars/userB%40mydomain.edu/events) for user B's default calendar using xoauth_requestor_id=userB...@mydomain.edu, all the colorIds for the events come back as null.

André Bocati

unread,
Nov 27, 2012, 1:08:04 AM11/27/12
to google-ca...@googlegroups.com
Hey James.

Did you have lucky returning the colorId for the events?

Can you let me know how you did it? All my colorIds are returning null......event tho was working before..... I am using the Google Calendar API 3.0

Thanks,
Andre.

James Dunne

unread,
Nov 27, 2012, 1:11:45 AM11/27/12
to google-ca...@googlegroups.com
Hi Andre,

Like I said in my reply to myself, I was fetching the duplicate events added to the user's primary calendar that were automatically duplicated by Google when I added the user as an attendee of the event. Those events don't get their colorIds copied from the original API insert request.

When you create an event and fetch it by eventId, you should be able to store and retrieve its colorId just fine.

Note that event colorIds are nearly useless unless you're creating events directly on the user's primary calendar. If you're creating events to be shared across multiple users' calendars, event colorIds won't get you anything at all.

--
You received this message because you are subscribed to the Google Groups "Google Calendar API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-calendar-api/-/enxlH8-FJG4J.
To post to this group, send email to google-ca...@googlegroups.com.
To unsubscribe from this group, send email to google-calendar...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-calendar-api?hl=en.



--
Regards,
James Dunne

André Bocati

unread,
Nov 28, 2012, 1:54:08 AM11/28/12
to google-ca...@googlegroups.com
i used to use the url and was working perfectly:


and use to return the colorId of the events and doesnt return at all anymore.

Any idea to get the colorId of my events ?????

Thanks in advanced.
Hi Andre,

To unsubscribe from this group, send email to google-calendar-api+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-calendar-api?hl=en.



--
Regards,
James Dunne

Philipp Mehrwald

unread,
Dec 18, 2013, 12:35:30 PM12/18/13
to google-ca...@googlegroups.com
Hi Andre,

did you ever find a solution to your problem, I am experiencing the same issue...

thank you,
Philipp

Craig O

unread,
Jul 23, 2014, 9:43:24 AM7/23/14
to google-ca...@googlegroups.com, philipp...@gmail.com
Any solutions to this?  I'm not getting colorid's back either (despite specifically asking for them)

Philipp Mehrwald

unread,
Jul 23, 2014, 1:23:27 PM7/23/14
to google-ca...@googlegroups.com, philipp...@gmail.com
I did not find a solution, it would have been a nice feature but was not necessarily required.

Lucia Fedorova

unread,
Jul 24, 2014, 6:35:29 PM7/24/14
to google-ca...@googlegroups.com, philipp...@gmail.com
Hi guys,
I'm not able to reproduce this.
When I insert an event like this:
 {
"end": {
"date": "2014-07-25"
},
"start": {
"date": "2014-07-21"
},
"colorId": "2"
}
I get a light blue chip on my calendar. 
What are the exact repro steps?

Ori Hoch

unread,
Dec 6, 2014, 3:25:05 PM12/6/14
to google-ca...@googlegroups.com, philipp...@gmail.com
I also encountered this, it looks like a bug.

Steps to reproduce:
1. On a user with other private calendars - create a new public calendar
2. Create an event on that new public calendar and set a color for that event
3. Create a public API access key
4. Using that public API access key - get the list of events from the public calendar

Expected behavior:
The event in the returned list of events will contain the colorId attribute

Actual behavior:
No colorId attribute

בתאריך יום שישי, 25 ביולי 2014 01:35:29 UTC+3, מאת Lucia Fedorova:

Ori Hoch

unread,
Dec 6, 2014, 3:36:56 PM12/6/14
to google-ca...@googlegroups.com, philipp...@gmail.com
I opened an issue about it:
https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3684

בתאריך יום שבת, 6 בדצמבר 2014 22:25:05 UTC+2, מאת Ori Hoch:

Lucia Fedorova

unread,
Dec 15, 2014, 6:04:24 PM12/15/14
to google-ca...@googlegroups.com, philipp...@gmail.com
Hi Ori,
color is right now a private event property. That means for example that if you organize an event and invite me, if you set your event to blue, I'll still see my event as red (because that is the color I have my calendar in by default). You can only see and modify this private property if you have at least write access (which is not the case usually when accessing public holidays).
Reply all
Reply to author
Forward
0 new messages