could you please give me a hint on how to share a single event via google calendar api?
That is I'd like to invite other users to see the event programmatically without sharing the whole calendar. To mimic the "Add guests" UI action
As Claudio mentioned, you need to use the Google Calendar Advanced API for this.
You'll want to use a patch
because you don't want to replace all the other data on the calendar invite. However, even in the case of patch
, since the attendees lives in an array, if you attempt to pass a patch such as this:
{
attendees: [ { email: "[email protected]"} ]
}
... it'll replace all old invitees (i.e. it'll remove anyone that was on the invite before you called patch
). To fix this, you must first get the current invitees, add a new person to the array, and then send a patch
.
You can see a detailed example of this in this answer which also explains how to use Google Apps Scripting to ensure an email is sent to the user when adding them to a calendar event (see the addGuestAndSendEmail()
method in that post).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With