Share via

Filtering Allday Events Using Graph API

Yurii Hrytsai 20 Reputation points
2024-10-16T14:22:15.6633333+00:00

The calendarView API call with the parameters:

calendarView?startdatetime=2024-10-16T00:00:01.0000&enddatetime=2024-10-16T23:59:59.0000

returns the following event:

{
   "originalStartTimeZone":"Europe/Kiev",
   "originalEndTimeZone":"Europe/Kiev",
   "iCalUId":"***",
   "uid":"***",
   "start":{
      "dateTime":"2024-10-14T00:00:00.0000000",
      "timeZone":"Europe/Kiev"
   },
   "end":{
      "dateTime":"2024-10-16T00:00:00.0000000",
      "timeZone":"Europe/Kiev"
   }
}

The original event timezone is -6, while the call timezone is +2. The parameter prefer=outlook.timezone="Europe/Kiev" is being used.

How can the selection of such events be omitted? A filter was attempted using:

&$filter=not(startswith(end/dateTime, '2024-10-16T00:00:00'))

but it returns a 500 error. Any advice on how to resolve this issue?

Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

Vasil Michev 127K Reputation points MVP Volunteer Moderator
2024-10-16T15:25:22.6+00:00

You should be able to use the isAllDay property for that. For example:

GET https://graph.microsoft.com/v1.0/users/******@domain.com/calendarView?startdatetime=2024-10-16T00:00:01.0000&enddatetime=2024-10-16T23:59:59.0000&$filter=isAllDay eq true

For negative filtering, adjust the filter to isAllDay eq false.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.