0
votes

Since today I have problem with one of 2 similar calls to Google Calendar API v3:

calendar.events.list

Both calls are requesting list of assignemnts and use privateExtendedProperty to filter them, but key=Value pairs are different.

When I have privateExtendedProperty set to myStatus=READY it returns events I need, but when I set privateExtendedProperty to myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM it returns no events, though I'm sure there are several events with this myId...

It appears that the calendar API list is returning an empty list when querying by a privateExtendedProperty with 90 characters long.

Everything worked fine for years, but it suddenly broke for some of my users this morning...

This is my request:

GET googleapis.com/calendar/v3/calendars/****/events?privateExtendedProperty=myId%3Dagxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYwauk6QgM&key={YOUR_API_KEY} 

This is the result I see in API explorer:

{
 "kind": "calendar#events",
 "etag": "\"*****\"",
 "summary": "*****",
 "description": "*****",
 "updated": "2018-02-20T03:18:35.098Z",
 "timeZone": "Asia/Tokyo",
 "accessRole": "owner",
 "defaultReminders": [
 ],
 "nextSyncToken": "CJDv1KDEs9kCEJDv1KDEs9kCGAU=",
 "items": [
 ]
}

Update 1: My privateExtendedProperty looks like this:

{
  "myStatus": "READY",
  "myId": "agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM",
  "another": "Another value",
  "another2": "Another value2"
}

When I query events with "myStatus=READY" - event is returned, but when I do the same with "myId=agxzfm1..." - it returns emtpy list.

Update 2: For those who have the same issue. As per suggestion, I created a new calendar and then duplicated some test data and tried long value in privateExtendedProperty query and it returned event as expected. It means, if this is a bug - not all calendars are affected and moving things to a new calendar might be a way to go.

1

1 Answers

0
votes

The document for Extended Properties says the limitations as follows.

  1. The maximum size of a property's key is 44 characters, and properties with longer keys will be silently dropped.
  2. The maximum size of a property's value is 1024 characters, and properties with longer values will be silently truncated.
  3. An event can have up to 300 shared properties totaling up to 32kB in size (keys size + value size).
  4. An event can have up to 300 private properties, totaling up to 32kB in size (keys size + value size), across all "copies" of the event.

From this, it seems that your case is out of the above limitations. In my environment, also I tried your situation. As the result, it was found that myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM can be used.

So can you confirm the following points again?

  1. It seems that your result retrieved by API explorer doesn't included extendedProperties in the property of items. When you set extendedProperties, it can be seen. If you use fields, it might be not able to be seen.
  2. Can you set extendedProperties with myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM again?
    • You can set it using calendar.events.patch.
  3. When you retrieve events with myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM using calendar.events.list, if you use the URL encoded value of myId%3dagxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM, please try to use the value without URL encode.

If this was not useful for you and I misunderstand your question, I'm sorry.

Edit :

  • If you retrieve the event using calendar.events.get, can the extendedProperties you set be seen? If you cannot see it, please insert extendedProperties again.
    • The endpoint is GET https://www.googleapis.com/calendar/v3/calendars/### calendar Id ###/events/### event Id ###?fields=extendedProperties%2Fprivate
  • In my environment, the same endpoint of yours works fine. So as a test, can you try to create new calendar and run that query? Because I worried whether the recent update of calendar affects this situation.