admin管理员组

文章数量:1290261

my case is a bit weird so i'll try to explain it in details. I've built an auto-approval appscript (based on different set of logics) and it works perfectly, with one edge case that i'm unable to workaround.

I'm retrieving all events in a specific time range using: calendar = CalendarApp.getDefaultCalendar(); calendar.getEvents(startDate, endDate);

I'm looping on each of the events, doing some logic to decide if it ned to be auto approved and color change the event. To approve the event and send event approvals I need to get the event object directly from the advanced calendar service: Calendar.Events.get(calendarId, eventId).

all of that works so far, the edge case that it doesn't work with is for events that were created by 3rd party services that are allowed to send emails on our domain behalf and not via google mx servers directly.

For example, when looking on those events manually in the calendar and trying to add a room to them, google will give this message on those events: "The event wasn't created in Google Calendar, so you can't add a room. Instead, you can create a duplicate event without guests to reserve a room and invite people to use it."

and in the code when using: Calendar.Events.get(calendarId, eventId) it will fail with an exception: "GoogleJsonResponseException: API call to calendar.events.get failed with error: Not Found"

It can't find these events, using the event id from event.getId() and also tried removing everything after the @ in the eventId and use that, also read some where to try splitting by "_" and user those parts.. (didn't had _ in my event ids).

I can't understand why it wont give me the event object.

any help/idea will be appriciated.

UPDATE: those events are being created outside of Google Workspace. In this case it is an hiring platform (helpeet.co/en/articles/3110293-set-up-email-messaging). and they send the invite to me and the candidate. the inizer is the platform email "[email protected]" and i'm just invited as guest

ty

本文标签: google workspaceRetrieve the event via Calendar Service in appscriptsStack Overflow