Searching Google Calendar extendedProperties does not return any match

Viewed 23

I am using Google Calendar API v3 in to search for a specific property/value. I was able to successfully create the extended property as you can see here:

{
 "kind": "calendar#events",
 "etag": "\"p33cf16d5ousve0g\"",
 "summary": "Ryan's Personal Camptivities",
 "updated": "2022-04-29T15:11:23.687Z",
 "timeZone": "America/Los_Angeles",
 "accessRole": "owner",
 "defaultReminders": [
  {
   "method": "popup",
   "minutes": 10
  }
 ],
 "nextSyncToken": "CNjwmaXHufcCENjwmaXHufcCGAUg67Ly0wE=",
 "items": [
  {
   "extendedProperties": {
    "private": {
     "OutlookEventGO": "AAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA="
    }
 ]
}

but when I go to search for the extendedProperty, i get no response:

https://www.googleapis.com/calendar/v3/calendars/ryan%40camptivities.com/events?privateExtendedProperty=OutlookEventGO%3DAAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA%3D&

{
 "kind": "calendar#events",
 "etag": "\"p33cf16d5ousve0g\"",
 "summary": "Ryan's Personal Camptivities",
 "updated": "2022-04-29T15:11:23.687Z",
 "timeZone": "America/Los_Angeles",
 "accessRole": "owner",
 "defaultReminders": [
  {
   "method": "popup",
   "minutes": 10
  }
 ],
 "nextSyncToken": "CNjwmaXHufcCENjwmaXHufcCGAUg67Ly0wE=",
 "items": []
}

Is this because of the encoding of the extendedProperty value? If so, how do I fix this? If not, what am I doing wrong?

Thanks in advance...

1 Answers

The problem is the = at the end of your privateExtendedProperty value

This seems to create issues when it comes to the url encoding of the property.

If you use a property value without an =, e.g. AAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA

you can perfectly retrieve it with out request:

https://www.googleapis.com/calendar/v3/calendars/ryan%40camptivities.com/events?privateExtendedProperty=OutlookEventGO%3DAAMkADNkODYzZGQ5LWY5ZGItNGFjZi1iMWMzLTI3MmY0YmIxMTcxNQBGAAAAAAC5E322QQ7ORLEmN7zGNq0zBwAUl432Bg61QItQhHQwcosuAAAAAAENAAAUl432Bg61QItQhHQwcosuAAF6QI0zAAA

Your privateExtendedProperty seems to be encoded, so if the = is important for you to decode the value back, you will need to add it back programatically when require.

Related