locked
O365 Calendar query - cannot identify recurring events RRS feed

  • Question

  • I am having trouble finding a way to efficiently handle recurring events through the O365 API. There does not seem to be a straightforward way to identify if an event recurs.

    I am using the O365 API to display calendar events within a specified day on my web app. The user picks a day, and my app displays the events for that day mirroring what is shown in OWA. I am querying the calendar events endpoint (../Me/Calendar/Events) and filtering the results using $filter in the query to narrow the response down to events for that day.

    However, this approach does not catch recurring events since the query only returns original event objects, not their recurrences.

    To solve that problem, I was hoping to query that same endpoint and filter off of the "Recurrence" property. I found that this property is always null. However, if I query a specific event using its ID (../Me/Calendar/Events(<event id>)), the response includes everything I need to reconstruct the recurrence pattern (i.e. frequency, day of week, # of occurrences, etc.).

    Although this gives me a way to handle recurring events, it is very inefficient to loop through each event to check for recurrences. This option is impractical since I would have to check all events ever created.

    Has anyone else come across this and is there a good way of handling recurring events through the O365 API?

    Thursday, June 26, 2014 8:48 PM

All replies

  • I found another property called "Type" which is of model Microsoft.Exchange.Services.OData.Model.EventType. The value "SeriesMaster" indicates that the event recurs, while "SingleInstance" is a one-time event. I tried using O365's $filter to filter the query as shown below

    ...<api_endpoint>?$filter=Type eq Microsoft.Exchange.Services.OData.Model.EventType'SeriesMaster'

    This query returns no values back.

    My other option, which is to get all events and filter on this property, will work and is much better than the previous option I posted above, but impractical for a user with many events.

    Is there a way to filter on this property via http query?

    • Edited by photohunts Wednesday, July 2, 2014 7:35 PM
    Wednesday, July 2, 2014 7:35 PM