John Davidson

php - Office365 Calendar Recurring Event API - get only changes, updated & deleted

0 comments
Message:


I have implemented Recurring Event with google api and I want to integrate office 365 calendar recurring as well, I can read the event from office 365 calendar api, but when I want to take only changed instances I can not find any api endpoint that return only changes like google does.


I'm using endpoints like:


GET https://graph.microsoft.com/me/calendars/{calendarId}/calendarview


GET https://graph.microsoft.com/me/calendars/{calendarId}/events


Endpoint 'events' return main recurring event, this is what I'm using to read the main event, and works fine.


Endpoint 'calendarView' returns all events calculated for recurring event, if is daily without end, it will return 365 events for whole year if you query that way.


The problem is I can't read updated or deleted instances for this recurring event. I tried delta/feed endpoint but returns everything without any status or information for updated or deleted instances/occurrences.


Does anyone have found any solution for this?


Thank you.



My Answer:
To get only changes and updated recurring events from the Office365 Calendar API, you can use the Delta Query feature provided by the Microsoft Graph API.

Here is an example of how you can use the Delta Query to retrieve only the changes and updated recurring events:

1. Make a GET request to the following endpoint to get the initial set of recurring events:

GET https://graph.microsoft.com/v1.0/me/events?$filter=recurrence eq true


2. In the response, you will receive a `@odata.deltaLink` property which contains a URL that you can use to retrieve only the changes and updated events. Save this URL for future requests.

3. To get only the changes and updated events, make a GET request to the deltaLink URL:

GET [deltaLink URL]


4. The response will contain only the changes and updated events since the last request. You can continue to use the deltaLink URL to retrieve incremental changes in the future.

By using the Delta Query feature, you can efficiently retrieve only the changes and updated recurring events from the Office365 Calendar API without having to fetch the entire set of events each time.

Rate this post

5 of 5 based on 7356 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us