I have successfully integrated NodeJS backend with google calendar. I retrieve all events from google calendar successfully.
Issue is following: not all fields are present in resulting event list. For example: some fields from organizer
are missing altogether.
This is my sample response:
{
"kind": "calendar#event",
"etag": "\"---\"",
"id": "---",
"status": "confirmed",
"htmlLink": "---",
"created": "2022-03-28T15:32:53.000Z",
"updated": "2022-03-28T15:32:53.093Z",
"creator": {
"email": "tornike.shavishvili@ngt.ge",
"self": true
},
"organizer": {
"email": "tornike.shavishvili@ngt.ge",
"self": true
},
"start": {
"dateTime": "2022-03-28T19:30:00+04:00",
"timeZone": "Asia/Tbilisi"
},
"end": {
"dateTime": "2022-03-28T20:30:00+04:00",
"timeZone": "Asia/Tbilisi"
},
"iCalUID": "---",
"sequence": 0,
"reminders": {
"useDefault": true
},
"eventType": "default"
}
Here are list of all parameters according to google documentation: Events Resource representations
The above response is from my personal calendar and the visit was created with my account.
I also have calendars that were shared with me. From those calendars, when events are created by different users, the organizer
field is missing altogether. See example Below:
[
{
kind: 'calendar#event',
etag: '"---"',
id: '---',
status: 'confirmed',
htmlLink: '---',
updated: '2022-03-29T06:24:21.598Z',
creator: { email: 'mari.chkonia@signify.ge' },
start: { dateTime: '2022-03-29T14:00:00+04:00', timeZone: 'Asia/Tbilisi' },
end: { dateTime: '2022-03-29T15:00:00+04:00', timeZone: 'Asia/Tbilisi' },
visibility: 'private',
iCalUID: '---'
}
]
I have researched it for several days but completely out of clue: what could be reason of missing fields? Maybe integration account needs some additional permissions?
I also want to mention that I am impersonating my personal mail, and I am using google API service account authentication.
Thank you
TL;DR: These are remnants of the now-defunct Google+.
Based on your example the missing fields under organizer
are displayName
and id
.
The documentation that you shared mentions that the organizer.displayName
field only shows if available. This is the same for the organizer.id
field, which should return the "Profile ID".
The question would be: what determines the availability of these fields, and what is a "Profile ID"?
The organizer.displayName
field is supposedly writable so I tried to manually set it via the insert API, since there doesn't seem to be an option for it in the UI. The API call was successful, but the field still didn't show up when I tried to retrieve the event afterwards.
This led me to a report in Google's issue tracker also claiming inconsistencies on when this field is returned. It appears that displayName
comes from the organizer's Google+ Profile, if it exists. This would also explain what a "Profile ID" is. The final response by a Googler before closing the report was the following:
From what I can tell this behavior is consistent with the Google Calendar UI, and there are times when the user's name is not shared. If interested I can work to determine the exact set of rules that govern this behavior, but in general it is working as intended.
Presumably some of the "times when the user's name is not shared" would be something like the Google+ profile being private. Since no one asked to clarify these rules we can no longer know them for sure.
Google+ and its API were shut down and replaced by Currents in 2019. This would mean that these fields are just vestiges probably left to avoid breaking old code. If you're interested in correcting the documentation or giving these fields a new purpose you could try to submit a request in Google's issue tracker.
Edit: I found one scenario where displayName
will still show up. If the user has a Currents public profile you will be able to see the field in your responses. Do note that this is not retroactive, so if the user creates a profile it won't show up in past events. Also, Currents is only for paid Google Workspace accounts.