An API that connects multiple Microsoft services, enabling data access and automation across platforms
Inconsistent response from Graph API calendarView
If some user has all day event in calendar for e.g. 14-15 of October (two days) in time zone -7 for example, the API call https://graph.microsoft.com/beta/me/calendar/calendarView?startdatetime=2024-10-16T00:00:01+0000&enddatetime=2024-10-16T23:59:59+0000 will return such event despite "2024-10-16T00:00:01 start time" parameter, if timezone of request differs from the calendar timezone. In my case I used outlook.timezone="Europe/Kiev". Also, please take in note that in the response all zones including an originated timezone is the same as in request header, so it is impossible to find out what timezone of the all day event and shift timezone accordingly on application side. In result, user see all day event that starts at 14 of October and lasts to 15 of October including despite 16 of October on calendar is chosen.
Response:
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('b639f016-8365-4575-bf0c-7e2d8fa0ecee')/calendar/calendarView",
"value": [
{
"@odata.etag": "W/\"3fO1SWVyaEiYtDFob8WbOgAAjTMFQg==\"",
"id": "AAMkADQwNDNlMzk1LWEzZTEtNDdkZC05MDMzLWI3NDNmYzFkYjI4MABGAAAAAACi3Rv2W1YLQo8h5C7vzqaFBwDd87VJZXJoSJi0MWhvxZs6AAAAAAENAADd87VJZXJoSJi0MWhvxZs6AAB-WTsnAAA=",
"createdDateTime": "2024-09-23T14:40:07.6647266Z",
"lastModifiedDateTime": "2024-10-14T07:39:03.5978147Z",
"changeKey": "***",
"categories": [],
"transactionId": null,
"originalStartTimeZone": "Europe/Kiev",
"originalEndTimeZone": "Europe/Kiev",
"iCalUId": "***",
"uid": "***",
"reminderMinutesBeforeStart": 1080,
"isReminderOn": false,
"hasAttachments": false,
"subject": "Sam PTO",
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": true,
"isCancelled": false,
"isOrganizer": false,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "free",
"type": "singleInstance",
"webLink": "***",
"onlineMeetingUrl": null,
"isOnlineMeeting": false,
"onlineMeetingProvider": "unknown",
"allowNewTimeProposals": true,
"occurrenceId": null,
"isDraft": false,
"hideAttendees": false,
"responseStatus": {
"response": "notResponded",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "****"
},
"start": {
"dateTime": "2024-10-14T00:00:00.0000000",
"timeZone": "Europe/Kiev"
},
"end": {
"dateTime": "2024-10-16T00:00:00.0000000",
"timeZone": "Europe/Kiev"
},
"location": {
"displayName": "",
"locationType": "default",
"uniqueIdType": "unknown",
"address": {},
"coordinates": {}
},
"locations": [],
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "*****",
"address": "*****"
}
},
"onlineMeeting": null
}
Moreover, I tried to do filtration in calendarView request to filter events of past days but Graph API responses with 500 error without any explanation of cause. Filter value, that were tried: &$filter=not(startswith(end/dateTime, '2024-10-16T00:00:00')), &$filter=end/dateTime ne '2024-10-16T00:00:00'
Please advice, how to change request to not receive such events or what approach should be used here.