Listening to Event deletion via PUSH

2019-09-09 17:22发布

问题:

I'm working with Google calendar API, all my site is about to manage my appointments. Now I'm integrating Google calendar to my site, so if I add or update any from my site the same are going to change in my Google calendar. If I change details in calendar I need to get my site DB updated via Push mechanism. Now I've established connection/mechanism to update the event details so if I change the date/time in my calendar my code is changing my DB with respect to Google calendar new date/time on that event via Push.

But I'm not sure how to delete any event which I delete in my calendar, for example:

If I delete an existing appointment in my calendar, that needs to be deleted in my DB too so it wont list on my appointment list.

Can someone help me how to track event deletion from Google API?

Is there a flag to notify at all?

回答1:

Deleted events have status set to "cancelled".

If you want to also have cancelled events included in the events list requests, you should specify showDeleted=true as a request parameter.

Check out the documentation for details https://developers.google.com/google-apps/calendar/v3/reference/events/list