4

I am creating an event with recurrence in Outlook Calendar and want to retrieve its full specification through API.

For example, the event repeats every weekend for a year. However, I removed some of the weekends from the time line, creating an exception to a recurrence rule.

How can I get these excluded dates through the API? When I receive a response with events from Outlook Calendar API I can not find an entry with excluded days.

Response with recurrence 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
                }
            },

1 Answers1

0

On the event object, there's a type property that has values including SingleInstance, Occurrence, Exception and SeriesMaster.

If you have the event ID of the series, you should be able to query 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'

According to the docs for listing event instances, this returns "occurrences and exceptions of the event in the specified time range".

Update: This might not actually work. I'm testing this now and the call returns a 200 status code, but an empty array of event exceptions. I'll investigate and update this when I learn more.

David
  • 2,412
  • 1
  • 14
  • 22
  • 1
    We cant get a list of excluding (deleted,removed) events. Event type: “exception” is the type for the event with the changed time, but not for event that has been removed from a series of recurrence. How can we get an events that has been deleted from recurrence? – svt.polevik Aug 17 '17 at 11:50
  • Also in a changed(exception) event we cannot see the changed time of event. The response with instances of events does not contain information about time of event that was rescheduled as exception. Exception event does not exist in events response as single independent event with changed time. This event is marked as exception, but information about it inherited from the series of events in which it was created. – svt.polevik Sep 13 '17 at 15:45
  • @svt.polevik Did you ever find a solution for this? – Gabriel Ittner May 08 '18 at 14:07
  • @GabrielIttner no, maybe guys from microsoft fixed this problem. – svt.polevik May 09 '18 at 15:14