We'd like to use Microsoft Graph API to create calendar events in order to sync the calendar events of our own application with the ones in Outlook. However, in our application, we have time periods that are closed for altering. So, the events become read-only on our side. Now we need Outlook to behave accordingly. Is there a way to create a (or alter an existing event to a) read-only calendar event (prevent the user from changing the time frame or deleting an event)?
It is not sufficient for us to only listen to changes made in Outlook because it's forbidden on our side to delete an event that's already "closed" and without deleting it in our application, there would be an inconsistency in the data.
Related
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.
My app keeps track of users' calendar events via Microsoft Graph API. My database records each synced event's ChangeKey, which helps my app determine whether a event has changed and should be processed by business logic.
I also subscribe to the change notification API so that my app doesn't have to poll often.
What I found out lately is that whenever the user dismisses an event's "reminder" via Outlook (via the Outlook reminder popup), which is a very common thing to do as Outlook puts all calendar events on reminders automatically, the Graph API would send out change notification on that event.
That would have been fine – except that the event's ChangeKey actually changes, even though nothing material about the event has changed (date times/subject/body etc). Since my app uses the ChangeKey property to compare events, the business logic triggers unnecessarily.
Is this normal behavior and doesn't that nullify the practical purpose of ChangeKey? Is there any workaround other than giving up the use of this property, and instead manually check for the equality of each meaningful field for event equality?
I am writing an outlook web Add-In where the user can create an appointment and book a meeting room through the software.
The problem is that once the user closes the Add-In and goes back to the calendar, they can freely change the date of the appointment by dragging it around, and the Add-In cannot see those changes, since it's not open.
That means that those changes do not get registered into the system and are essentially only local to the user who made them. I need a way that I can detect whenever the user changes the date of an appointment, so that I can update the data on my end.
I have heard about subscribing to notifications but I'm not sure that is the best solution. Any Ideas would be highly appreciated.
Not from a web addin - you can do that from a standalone app that continuously runs and uses either the Outlook Object Model (Items.ItemChange event) or EWS to receive the folder notifications. Or you can do that from a COM addin that uses the Items.ItemChange event.
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.
I have a plugin which syncs read-only shared calendars in Outlook with our collaboration system. I need to make sure the user cannot delete any appointments in these read-only calendars. It's possible to attach an event handler to any appointment in Outlook (this works) but it won't work for recurring events. Each occurrence in the recurrence pattern is a separate object in Outlook, and the app must attach an event handler to each of such objects. If the recurrence pattern is endless (which is quite popular for such appointments), the app should attach infinite number of event handlers.
Is it possible to attach an event handler to some of kind of a grouping object (if such entity exists) for all occurrences at once, or is there any other method of solving my task?
When an instance of a recurring appointment is deleted, the master appointment will be modified. You can intercept that change by subscribing to the AppointmentItem.Write event, whcih has the Cancel parameter.