Retrieving excluded dates from recurring events through the Microsoft Outlook Calendar API

I am creating a recurring event in Outlook calendar and want to get its full specification via API.

For example, the event repeats every weekend throughout the year. However, I removed some weekend from the time string by creating an exception to the recurrence rule.

How can I get these excluded dates via the API? When I receive a response with events from the Outlook Calendar API, I cannot find the entry with excluded days.

Repeat response from Outlook Calendar API:

"recurrence": {
                "pattern": {
                    "type": "weekly",
                    "interval": 1,
                    "month": 0,
                    "dayOfMonth": 0,
                    "daysOfWeek": [
                        "saturday",
                        "sunday"
                    ],
                    "firstDayOfWeek": "monday",
                    "index": "first"
                },
                "range": {
                    "type": "endDate",
                    "startDate": "2017-08-19",
                    "endDate": "2018-01-30",
                    "recurrenceTimeZone": "FLE Standard Time",
                    "numberOfOccurrences": 0
                }
            },

      

+3


source to share


1 answer


In the event object there is a property type

that has a value, including SingleInstance

, Occurrence

, Exception

and SeriesMaster

.

If you have a series event ID, you should be able to request exceptions like this: https://graph.microsoft.com/v1.0/me/events/[series id]/instances?startdatetime=2017-08-14T16:35:08.284Z&enddatetime=2017-08-18T16:35:08.284Z&$filter=type eq 'Exception'



As per the docs for enumerating event instances , this returns "occurrences and exceptions of an event in the specified time range".

Refresh . This may not work. I am testing this now and the call returns a 200 status code but an empty array of event exceptions. I will research and update this as I learn more.

0


source







All Articles