Attendee not getting meeting invite on creating event using service account, google calendar API - google-api

Hi I am creating an event using service account and added attendees. The response returned correctly but attendees are not getting invite mails. The Service account is not linked (shared) with any google account. Though to login into API console I used my gmail account. Calendar Id was given as Primary. Where the event will get created, on Service account's Calendar or my primary Calendar?. I could not see it on mine Calendar but response returned with Status "Confirmed". I am more interested in invites rather where the original event got created.
Any help would be appreciated !!!

You need to remember that a service account is not you. Think of a service account as a dummy user. It has its own calendar account, drive account and probably a bunch more. When you inserted an event into primary you inserted it into the service accounts primary calendar.
You have a few options.
Share your primary calendar with the service account. Just add it as a user. Find the calendar id in the settings and have the service account insert into that calendar id.
Have the service account share its primary calendar with you by granting you permissions to it. you should then be able to see it on the bottom left hand side of the Google calendar website.
Have the service account invite you to the event on the service accounts Google calendar.
Have the service account create the event with you as an attendee event.insert check the body of the request.

Related

Organizer does not receive email notification when attendee declines the event

We use a service account to authenticate google calendar and programmatically create calendars and appointment events. However, when a customer declines an event, there's no notification whatsoever of the decline and we cannot find any email regarding the decline in the admin or organizer's email inbox. is it because the service account is a dummy user? How can we get the organizer to be tied to an actual email account so people can get notification of the response status of the attendee?
We tried
create the calendar and event programmatically, attendee declines, no notification (despite setSendNotification("all") in the API call)
create the calendar and event programmatically, move the organizer to a different calendar (new organizer), attendee declines, no notification for the new organizer (despite setSendNotification("all") in the API call)
update code
googleAPIHelper.executeWithThrottling(service.events().update(calendarId, remoteEvent.getId(), remoteEvent).setSendUpdates("all"), Event.class);
insert code
googleAPIHelper.executeWithThrottling(service.events().insert(calendarId, eventToInsert).setSendUpdates("all"), Event.class);
move organizer code
googleAPIHelper.executeWithThrottling(service.events().move(calendarId, remoteEvent.getId(), destinationCalendarId), Event.class);
As it turned out, for each calendar the organizer owns (found in "Other Calendars"), we have to toggle the "Other notifications" settings to receive an email (i.e. Event responses). The default is set to "None."
E.g.
See also: https://www.youtube.com/watch?v=wgbpsm82AaY

How to create google resource calendar using any API?

I'm looking for a way to create resource calendars for shared rooms and for booking using any google API. In google documentation, it is mentioned that:
The Calendar API does not offer a way to create resource calendars. To do this, you need to use the Directory API's Calendar Resource object.
But the link mentioned refers to the creating calendar resource, not resource calendar!
Think of a resource room more like a user.
You can book resources and rooms by adding them to events as attendees, using their email address. When they receive the invitation, they automatically accept or decline the event based on the availability and access right of the inviting user.
Its not really a calendar. By adding the resource as an attendee for an event you are booking that room.

Edit Google Calendar "From" and "Organizer"

I want to create event via google calendar api using Go. I found out that the sender (From) is whoever responsible in client_id I provide in the google API, in this case me. Can I edit this sender, so that it is not sent from me? At least I can edit the display name of the sender, the email I think will always be my email
Also about editing the organizer, I tried to use move action but it only moves the event, not change the organizer. Is there other way to edit organizer?
To address your questions:
1. Can I create an event from another address?
What you want can be done by creating a service account and performing domain-wide-delegation
What is a service account?
A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs - in your situation the Calendar API.
After creating the above mentioned service account, you will have to perform domain-wide-delegation and impersonate a user in your domain in order to be able to create the event wanted.
Now, when writing the code for your application, you will have the use the credentials that were created for this account in order to authorize the requests.
OR
If you want to specifically edit only the display name of the creator of the event, you can perform an update request:
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
And add in the request body this:
"creator": {
"displayName": "UPDATED DISPLAY NAME"
}
2. Can I edit the organizer?
According to the Calendar API Documentation:
organizer > The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event.
Therefore, the organizer can be changed/updated only when importing the event in question.
Reference
Authorizing Requests to the Google Calendar API
;
Creating A Service Account;
Calendar API Events Resource;
Calendar API Events:Update.

Send calendar event invitations on behalf of a user with Microsoft Graph

I have a web app that allows receptionists to create calendar events on Outlook/Office365. To manage the events I use Microsoft Graph. The app sends the Graph requests under his own identity, because I need it to have no user interaction for logging in, so it uses Client_ID and Client_Secret with administrator rights to do everything. I can create events on the calendars of any user in the organization, which kinda works like creating an event "On behalf of", but there's a problem. When you create an event in someone else's calendar, Outlook will send the invitations as the calendar's owner, and this means that if the owner doesn't have permission to send messages to a mailbox (for example, a room mailbox), the invitation will never arrive. I need it to send the invitations from another user account (the receptionist that creates the event), like Office 365 does when you create an event on a shared calendar. Is that possible? Or is there any workaround to accomplish what I need?

Google Calendar Resource: How to get calendar ID from event instance?

If you list Google Calendar events using this API or particular event using this API specifying Calendar Resource room ID instead of calendar ID, you get list of all events associated to that Calendar Resource.
If you then want to delete or modify that event using domain-wide delegation of authority you can get event owner form creator.email field.
The question is how to get calendar ID where the event is created to be able to delete or modify it?
Of course you can try to use creator's e-mail or primary for the calendar ID but this fails if the user created the event in any other than default calendar.

Resources