Is there a way to send a note when deleting an event in the Google Calendar v3 API? - google-api

In the Google Calendar web interface it's possible to send a note when cancelling (deleting) an event, like so:
Is this also possible via the v3 Google Calendar API? I looked at the Event delete API docs (and others), but there doesn't seem to be a parameter or option.

If you check the documentation for events.delete you will find that there is an optional parameter for sending updates to the user upon deletion

According to DaImTo it is not currently possible to set the note text when sending notifications about cancelled events.
If you'd like to see this feature implemented, star this issue.

Related

How to be aware of the creation of a new event in a google calendar? [duplicate]

I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.

Hot to enable Cloud Elements Microsoft Graph Calendar webhooks for all calendars?

By default, when I integrate my Microsoft account with cloud elements:
https://developers.cloud-elements.com/docs/elements/microsoftgraph/
I only get notifications for my default calendar. But, in fact, I have like 5+ calendars. I want to get notifications about changes in all of them.
For now, I can only think of making a new end-point that accepts calendar ID and then I invoke this endpoint with the result of invocation:
GET /calendars
But, this looks like a hack. Is there a better solution to listen to all the calendars that I have using Cloud Elements?
According to your description, I assume you want to get the notifications for your calendar when the calendar changed.
We can use the subscription endpoint to get the notifications. For more detail about this endpoint, we can refer to this document
In the Cloud Elements UI, if you select the instance and click the api docs you will see four sections "information", "setup", "resources", and "models". Select resources and you will see one that has POST /webhooks
This is the call the Cloud Elements sends on webhook provision. If you want to change the body of the webhook go to the PreRequest Hook where you will see javascript that is creating a post body that will be sent to Microsoft.
By default the body you see in the javascript looks like:
var body={
"changeType": "created,updated,deleted",
"notificationUrl": "{webhookCallbackUrl}",
"resource": "/me/events",
"expirationDateTime": newDate
}
If you want to change what resources you get notification for you can do so in this body and using the documentation that was provided in the previous answer

Google Calendar event Created/Updated/Deleted Webhook?

I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.

Accepting calendar invites via Google API

How do I accept a calendar invite using something like the Google Calendar API or the Google Gmail API?
Bonus points if you can point me how to do it in Ruby, but just a hint at which API I should be using would be more than fine.
You should be using events patch.
First create an Event with just the information you want to change. In this case, this will be the single attendee (even if there are multiple attendees) whose response you want to modify (which should be the same as the user under which the call is made), and the corresponding response status ("accepted", "declined", "tentative").
Then you execute patch, passing in the event id and the sparse event created above.
An example in Java is at https://stackoverflow.com/a/41054893/80075

Trigger script on Google calendar event

I want to trigger some script when new calendar event is created in Google Calendar (say calling some rest API that enters event information to my database). I do not want any kind of UI that triggers the script. Is it possible to achieve this using Google gadget since I do not want any UI? I would really appreciate the help as I am new to Google API.
Thanks a lot
Shubhra
Calendar API has something like notifications. See this link: Push Notifications. From documentation:
The Google Calendar API provides push notifications that let you watch
for changes to resources. You can use this feature to improve the
performance of your application. It allows you to eliminate the extra
network and compute costs involved with polling resources to determine
if they have changed. Whenever a watched resource changes, the Google
Calendar API notifies your application.
Google Calendar API (relevant docs) provides a watch endpoint that allows you to specify a webhook upon certain events.
To set up the webhook, you can call the Calendar API endpoint a POST request to https://www.googleapis.com/calendar/v3/calendars/calendarId/events/watch with the body
{
"id": string
"type": string,
"address": string
}
The "address" field tells Calendar what endpoint to call when there is a new Calendar event. You'll need to create and host this endpoint yourself.
Another option is to use a service like Zapier, which has fantastic integrations for Google Calendar and makes setting up a listener (i.e. a trigger) and corresponding action very simple.

Resources