Miaosen Wang
Miaosen Wang

Reputation: 430

Microsoft Graph's Calendar API doesn't return recurring calendar events

I am using the CalendarView API of Microsoft Graph. Based on the offical documentation: https://graph.microsoft.io/en-us/docs/api-reference/beta/api/user_list_calendarview

I did this:

GET https://graph.microsoft.com/beta/me/calendarview?startDateTime=2016-9-07&endDateTime=2016-10-02    

However I don't see any recurring events. I can see other events happens before and after the recurring ones.

More information after the initial posting: The problem occurs if the date range goes over the week border. For example, I have an recurring event on 2016-09-08, If I set the start date to 2016-09-07 and end date to 2016-09-10, it would work, but if I set the end date to 2016-09-11, the events won't show up.

Upvotes: 2

Views: 2734

Answers (2)

Slipstream
Slipstream

Reputation: 14812

As Miaosen Wang mention the default page size is 10. As a workaround you can increase the page size adding the parameters "orderby" and "top" to you query.

params:

$orderby=start/dateTime DESC
$top=100

e.g.

GET https://graph.microsoft.com/beta/me/calendarview?startDateTime=2016-9-07&endDateTime=2016-10-02&%24$orderby=start/dateTime%20DESC"&%24top=100  

Upvotes: 1

Miaosen Wang
Miaosen Wang

Reputation: 430

@Michael Mainer helped to identify the root cause:

The calendar API has a default page size of 10. One should follow the "@odata.nextLink" property to obtain all results. The paged results is not sorted by start date unless "OrderBy" is specifically added.

Upvotes: 2

Related Questions