Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 253
jasan Avatar asked Feb 03 '17 10:02

jasan


People also ask

Can I recover a deleted Google Calendar event?

When you go to the trash, you can restore events or delete them forever. Important: Anyone who has "Make changes to events" or "Make changes AND manage sharing" permission for the calendar can delete events and see and restore events from that calendar's trash. On your computer, open Google Calendar. Trash.

Why are my events disappearing on Google Calendar?

Corrupted files in the cache Now when these cache files become corrupted, you may see your Google Calendar events disappear. That's because these corrupted files hamper smooth calendar events syncing. Therefore, any changes you made in your Google calendar fail to reflect as an updated calendar.

Is there a way to see when a Google Calendar event was created?

Once you've found your event look for the two lines titled CREATED and LAST-MODIFIED lines which come up before the SUMMARY or DESCRIPTION lines. These show the dates when the event was created and last modified (weird huh!) in YYYYMMDD and using Greenwich Mean Time.

Is there a difference between remove event and delete event from Google Calendar?

When you delete an event, it is erased permanently from every nonpublished and published calendar where it appears. You can't Remove events from the calendar that owns them; to eliminate events from the owning calendar, you have to Delete them.


2 Answers

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

like image 87
Pacio Avatar answered Nov 14 '22 08:11

Pacio


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.

like image 42
Scott Reed Avatar answered Nov 14 '22 07:11

Scott Reed