Our code started throwing the following error today, for a very simple findMeetingTimes request.
This is the error:
{
"error": {
"code": "UnknownError",
"message": "{\"ClassName\":\"System.ArgumentNullException\",\"Message\":\"Value cannot be null.\",\"Data\":null,\"InnerException\":null,\"HelpURL\":null,\"StackTraceString\":\" at System.String.Join(String separator, String[] value)\\r\\n at Microsoft.Griffin.WebService.Calendar.Scheduling.DefaultController.<ExecuteWorkflow>d__53`2.MoveNext()\",\"RemoteStackTraceString\":null,\"RemoteStackIndex\":0,\"ExceptionMethod\":\"8\\nJoin\\nmscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\\nSystem.String\\nSystem.String Join(System.String, System.String[])\",\"HResult\":-2147467261,\"Source\":\"mscorlib\",\"WatsonBuckets\":null,\"ParamName\":\"value\"}",
"innerError": {
"request-id": "f9153038-b8e2-41a8-bba6-dad2a8cc3afa",
"date": "2019-09-10T12:01:37"
}
}
This is the POST request
{
"attendees": [{
"emailAddress": {
"address": "amy#domain.com"
},
"type": "required"
}],
"timeConstraint": {
"timeslots": [{
"start": {
"dateTime": "2019-09-10T12:01:36",
"timeZone": "UTC"
},
"end": {
"dateTime": "2019-09-17T12:01:36",
"timeZone": "UTC"
}
}]
},
"meetingDuration": "PT30M",
"maxCandidates": 4,
"minimumAttendeePercentage": 100
}
Anyone got an idea what might be causing this?
// Edit:
Some more testing revealed that this is still working with a bearer token from Microsoft Graph Explorer, but not our own token which generated from an AzureAD app registration. From what we understand the tokens should be both valid (and have been up until a few hours ago... Our token also works for other endpoints)
Our token data:
{
"aud": "https://graph.microsoft.com",
"iss": "https://sts.windows.net/0e7219f7-4c4d-47e7-b98a-7b9b9de02b80/",
"iat": 1568152509,
"nbf": 1568152509,
"exp": 1568156409,
"acct": 0,
"acr": "1",
"aio": "******",
"amr": [
"pwd",
"mfa"
],
"app_displayname": "Outlook Meetings for Jira",
"appid": "fb930189-fe2c-4b11-b424-f576f7b371b3",
"appidacr": "1",
"family_name": "*******",
"given_name": "*****",
"ipaddr": "185.85.64.210",
"name": "*****",
"oid": "12ad9a79-78ae-424a-b6ef-a6ec78f69f3f",
"platf": "3",
"puid": "10033FFF8670ACD2",
"scp": "Calendars.ReadWrite.Shared email offline_access User.Read User.ReadBasic.All",
"signin_state": [
"kmsi"
],
"sub": "QsD80H0dBCYK4wttPZFIY1w_Pi5Ygbn9OwKuiNkNPXo",
"tid": "0e7219f7-4c4d-****-b98a-7b9b9de02b80",
"unique_name": "...#....com",
"upn": "...#....com",
"uti": "uzKz01rSV0SD1kTwBZJkAA",
"ver": "1.0",
"wids": [
"62e90394-69f5-4237-9190-012177145e10"
],
"xms_tcdt": 1374053072
}
Related
not sure what I'm doing wrong here. I wish to add a meeting with attendees into the organizer's calendar, then have the Exchange automatically send meeting invites to attendees. I want the attendees to be able to accept, decline, etc the invite as per the behaviour in Outlook, but my requests currently have the attendee automatically accept the invitation upon adding the event. Any idea what I'm doing wrong?
Request:
POST /users/{organizer#email.com}/events
{
"subject": "My Subject",
"start": {
"dateTime": "2021-10-10T12:00:00",
"timeZone": "Singapore Standard Time"
},
"end": {
"dateTime": "2021-10-10T14:00:00",
"timeZone": "Singapore Standard Time"
},
"responseRequested": true,
"attendees": [
{
"emailAddress": {
"address": "attendee#email.com",
"name": "Attendee"
},
"type": "required"
}
]
}
Response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(...)/events/$entity",
"#odata.etag": "..."",
"id": "AAMk...",
"createdDateTime": "...",
"lastModifiedDateTime": "...",
"changeKey": "...",
"categories": [],
"transactionId": null,
"originalStartTimeZone": "Singapore Standard Time",
"originalEndTimeZone": "Singapore Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E008...",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "My Subject",
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "...",
"onlineMeetingUrl": null,
"isOnlineMeeting": false,
"onlineMeetingProvider": "unknown",
"allowNewTimeProposals": true,
"isDraft": false,
"hideAttendees": false,
"recurrence": null,
"onlineMeeting": null,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta name=\"Generator\" content=\"Microsoft Exchange Server\"><!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style></head><body><font size=\"2\"><span style=\"font-size:11pt;\"><div class=\"PlainText\"> </div></span></font></body></html>"
},
"start": {
"dateTime": "...",
"timeZone": "Singapore Standard Time"
},
"end": {
"dateTime": "...",
"timeZone": "Singapore Standard Time"
},
"location": {
"displayName": "",
"locationType": "default",
"uniqueIdType": "unknown",
"address": {},
"coordinates": {}
},
"locations": [],
"attendees": [
{
"type": "required",
"status": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Attendee",
"address": "attendee#email.com"
}
}
],
"organizer": {
"emailAddress": {
"name": "Organizer",
"address": "organizer#email.com"
}
}
}
It can happen in two cases.
Outlook automatically accepts all meeting requests on behalf of groups. You can accept, tentatively accept, or decline meeting requests for user calendars only.
The second case is that user set up Outlook to automatically accept meetings.
Check Outlook->File->Options->Calendar->Automatic accept or decline
According to the document, I try to use Graph API to create a all-day repeated event on my calendar, but the server always responses 400: TimeZoneNotSupportedException.
Is there any wrong in my request?
Here is my request and server response.
POST /me/calendars/${one_of_my_calendar_id}/events
Request body:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('6cb879ad-1d01-4aed-bcc5-763e3f51c535')/events/$entity",
"#odata.etag": "W/\"BfXylo4WykyAenTZICXL5AABk4B1gA==\"",
"id": "AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAACB0WDVAAAF9fKWjhbKTIB6dNkgJcvkAAGTapeDAAA=",
"createdDateTime": "2019-03-07T10:25:29.5732546Z",
"lastModifiedDateTime": "2019-03-07T10:25:29.6573241Z",
"changeKey": "BfXylo4WykyAenTZICXL5AABk4B1gA==",
"categories": [],
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"iCalUId": "040000008200E00074C5B7101A82E00800000000FB7128DC464BD4010000000000000000100000006176917542798940B4FDBBFBA5B474A6",
"reminderMinutesBeforeStart": 0,
"isReminderOn": false,
"hasAttachments": false,
"subject": "Repeat-",
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": true,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": false,
"seriesMasterId": null,
"showAs": "free",
"type": "seriesMaster",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAACB0WDVAAAF9fKWjhbKTIB6dNkgJcvkAAGTapeDAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": null,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "<html><head><meta name=\"Generator\" content=\"Microsoft Exchange Server\">\r\n<!-- converted from text
-->\r\n<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; }
--></style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size:11pt;\"><div class=\"PlainText\"> </div></span></font>\r\n</body>\r\n</html>\r\n"
},
"start": {
"dateTime": "2018-09-25T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-09-26T00:00:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "",
"locationType": "default",
"uniqueIdType": "unknown",
"address": {},
"coordinates": {}
},
"locations": [],
"recurrence": {
"pattern": {
"type": "weekly",
"interval": 1,
"month": 0,
"dayOfMonth": 0,
"daysOfWeek": [
"tuesday"
],
"firstDayOfWeek": "monday",
"index": "first"
},
"range": {
"type": "endDate",
"startDate": "2018-09-25",
"endDate": "2019-03-12",
"recurrenceTimeZone": "",
"numberOfOccurrences": 0
}
},
"attendees": [],
"organizer": {
"emailAddress": {
"name": "MYNAME",
"address": "MYNAME#MYMAIL.com"
}
} }
Server response:
http code: 400
{
"error": {
"code": "TimeZoneNotSupportedException",
"message": "A valid TimeZone value must be specified. The following TimeZone value is not supported: ''.",
"innerError": {
"request-id": "4833ea1a-3371-4d3e-b28e-193fec18f723",
"date": "2019-03-07T11:01:36"
}
}
}
You're posting the entire object, including several read-only properties. This will always result in a failure of some kind.
When working with Microsoft Graph (most any REST API actually), you should only submit the properties you want to set:
{
"subject": "Repeat-",
"isAllDay": true,
"isReminderOn": false,
"showAs": "free",
"body": {
"contentType": "html",
"content": "<html><head><meta name=\"Generator\" content=\"Microsoft Exchange Server\">\r\n<!-- converted from text\r\n<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; }</style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size:11pt;\"><div class=\"PlainText\"> </div></span></font>\r\n</body>\r\n</html>\r\n"
},
"recurrence": {
"pattern": {
"type": "weekly",
"interval": 1,
"daysOfWeek": ["Tuesday"]
},
"range": {
"type": "endDate",
"startDate": "2018-09-25",
"endDate": "2019-03-12"
}
}
}
After I remove the 'recurrenceTimeZone' from the recurrence/range value, the server responses 200 OK and the new event is be created successfully.
It seems that the recurrenceTimeZone shouldn't be an invalid timezone value.
I'm trying to create an Event via Microsoft Graph by providing following JSON input:
{
"subject": "Test event",
"organizer": {
"emailAddress": {
"name": "Name 1",
"address": "name1#graffter.onmicrosoft.com"
}
},
"start": {
"dateTime": "2018-10-18T01:45:38",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-10-18T04:45:38",
"timeZone": "UTC"
},
"attendees": [
{
"emailAddress": {
"name": "Name 2",
"address": "name2#graffter.onmicrosoft.com"
},
"type": "required"
},
{
"emailAddress": {
"name": "room",
"address": "room#graffter.onmicrosoft.com"
},
"type": "resource"
}
],
"body": {
"content": "Prueba de evento",
"contentType": "HTML"
},
"location": {
"displayName": "room",
"locationEmailAddress": "room#graffter.onmicrosoft.com"
}
}
Sometimes, however, I'm getting the following error response (and I mean sometimes) :
{
"error": {
"code": "ErrorPropertyValidationFailure",
"message": "At least one property failed validation.",
"innerError": {
"request-id": "9f528d43-ed74-4c02-a29c-f01e47f24717",
"date": "2018-10-18T12:14:31"
}
}
}
So the thing is, with the same code and the same JSON request (changing dates of course), it sometimes worked while others times it fails.
I'm following the official documentation, I have all the permissions needed, and the access_token I'm using works perfectly with other API calls such as /messages.
I have an app that loads calendar items into a database, and needs to stay in sync with the given user's calendar. Unfortunately, when querying Microsoft Graph for a given date range using Delta tokens, the original event's data is being returned. However, if the Delta call is removed from the query, recurring events are returned as expected.
The call without Delta:
https://graph.microsoft.com/v1.0/me/calendarView?startDateTime=2018-06-26T00:00:00&endDateTime=2018-06-27T00:00:00&$select=id,subject,start,end
Returns:
{
"#odata.etag": "W/\"vDPrV1TQYUmam8nxPycXGwABJbtmSQ==\"",
"id": "AAMkADZhMjA2YTNmLTM0NDktNDYyNy05Njk2LTRjNThhMDZkZDBmOQFRAAgI1dr3wqKAAEYAAAAAY_l4isQ6OkOWdkEvK3rrDQcAvDPrV1TQYUmam8nxPycXGwAAAAABDQAAvDPrV1TQYUmam8nxPycXGwAAAtcOVAAAEA==",
"subject": "Daily recurring event",
"start": {
"dateTime": "2018-06-26T14:30:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-06-26T14:45:00.0000000",
"timeZone": "UTC"
}
}
However, when trying to add the "delta" call to the request using the same start/end dates, the event's ORIGINAL dates (and Id) are returned. Additionally, the SELECT columns are ignored, entirely.
The call with Delta:
https://graph.microsoft.com/v1.0/me/calendarView/delta?startDateTime=2018-06-26T00:00:00&endDateTime=2018-06-27T00:00:00&$select=id,subject,start,end
Returns:
{
"#odata.type": "#microsoft.graph.event",
"#odata.etag": "W/\"vDPrV1TQYUmam8nxPycXGwABJbtmSQ==\"",
"createdDateTime": "2017-04-19T15:02:38.8680605Z",
"lastModifiedDateTime": "2018-06-25T14:15:14.2194888Z",
"changeKey": "vDPrV1TQYUmam8nxPycXGwABJbtmSQ==",
"categories": [],
"originalStartTimeZone": "Eastern Standard Time",
"originalEndTimeZone": "Eastern Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E0080000000050B9E76D2CF2D001000000000000000010000000831C6E0657580F44A0799E55EB5F2E49",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Daily recurring event",
"bodyPreview": "",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": false,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "seriesMaster",
...
"id": "AAMkADZhMjA2YTNmLTM0NDktNDYyNy05Njk2LTRjNThhMDZkZDBmOQBGAAAAAABj6XiKxDo6Q5Z2QS8reusNBwC8M_tXVNBhSZqbyfE-JxcbAAAAAAENAAC8M_tXVNBhSZqbyfE-JxcbAAAC1w5UAAA=",
"responseStatus": {
"response": "accepted",
"time": "2017-04-19T15:02:00Z"
},
"body": {
"contentType": "html",
"content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta name=\"Generator\" content=\"Microsoft Exchange Server\">\r\n<!-- converted from rtf -->\r\n<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>\r\n</head>\r\n<body>\r\n<font face=\"Calibri\" size=\"2\"><span style=\"font-size:11pt;\">\r\n<div> </div>\r\n<div> </div>\r\n</span></font>\r\n</body>\r\n</html>\r\n"
},
"start": {
"dateTime": "2015-09-22T14:30:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2015-09-22T14:45:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "on your feet",
"locationType": "default",
"uniqueId": "on your feet",
"uniqueIdType": "private"
},
"locations": [
{
"displayName": "on your feet",
"locationType": "default",
"uniqueId": "on your feet",
"uniqueIdType": "private"
}
],
"recurrence": {
"pattern": {
"type": "weekly",
"interval": 1,
"month": 0,
"dayOfMonth": 0,
"daysOfWeek": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday"
],
"firstDayOfWeek": "sunday",
"index": "first"
},
"range": {
"type": "noEnd",
"startDate": "2015-09-22",
"endDate": "0001-01-01",
"recurrenceTimeZone": "Eastern Standard Time",
"numberOfOccurrences": 0
}
},
"attendees": [
{
"type": "required",
"status": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Nunya Biz",
"address": "biz#markie.com"
}
}
],
"organizer": {
"emailAddress": {
"name": "Nunya Biz",
"address": "biz#markie.com"
}
}
},
Can anyone tell me how can I get the Delta query to return the recurring event's instance, as opposed to the "seriesMaster"?
Ah, I figured it out! The delta returns the seriesMaster, but also returns the instance details (occurrence) at the end. My bad for leaving it out of the results in the original post.
The missing link:
{
"#odata.type": "#microsoft.graph.event",
"#odata.etag": "W/\"DwAAABYAAAC8M+tXVNBhSZqbyfE/JxcbAAElu2ZJ\"",
"seriesMasterId": "AAMkADZhMjA2YTNmLTM0NDktNDYyNy05Njk2LTRjNThhMDZkZDBmOQBGAAAAAABj6XiKxDo6Q5Z2QS8reusNBwC8M_tXVNBhSZqbyfE-JxcbAAAAAAENAAC8M_tXVNBhSZqbyfE-JxcbAAAC1w5UAAA=",
"type": "occurrence",
"id": "AAMkADZhMjA2YTNmLTM0NDktNDYyNy05Njk2LTRjNThhMDZkZDBmOQFRAAgI1dr3wqKAAEYAAAAAY_l4isQ6OkOWdkEvK3rrDQcAvDPrV1TQYUmam8nxPycXGwAAAAABDQAAvDPrV1TQYUmam8nxPycXGwAAAtcOVAAAEA==",
"start": {
"dateTime": "2018-06-26T14:30:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-06-26T14:45:00.0000000",
"timeZone": "UTC"
}
},
Note that the "type" = "occurrence", and the "seriesMasterId" points back to the seriesMaster's Id field. This contains the correct start/end information for the event.
From yesterday I started receiving an error in my service (production environment) when trying to call Outlook Calendar REST API endpoint:
POST https://outlook.office.com/api/v2.0/me/findMeetingTimes
with following request body:
{
"Attendees": [
{
"Type": "optional",
"EmailAddress": {
"Address": "...",
"Name": null
}
},
{
"Type": "required",
"EmailAddress": {
"Address": "...",
"Name": null
}
}
],
"LocationConstraint": {
"IsRequired": true,
"SuggestLocation": false,
"Locations": [
{
"DisplayName": "..."
}
]
},
"TimeConstraint": {
"Timeslots": [
{
"Start": {
"DateTime": "2017-05-05T00:00:00",
"TimeZone": "UTC"
},
"End": {
"DateTime": "2017-05-05T21:59:59",
"TimeZone": "UTC"
}
}
]
},
"MaxCandidates": 1000,
"MeetingDuration": "PT30M",
"IsOrganizerOptional": true }
Here is the response I get:
{
"error": {
"code": "ErrorInternalServerError",
"message": "Invalid value for arg:Overlaps are not supported within TimeSlots, value:
{\"start\":2017-05-04T22:00:00Z,
\"min\":1440}
\r\nParameter name: Overlaps are not supported within TimeSlots"
}
}
Everything was working fine with until yesterday. There were no changes in my service codebase. It seems to be related with some changes in O365 API itself but there are no recent updates in documentation...
Any idea what might be wrong?
UPDATE: Without any modification in the request the server response is now:
{
"error": {
"code": "ErrorInternalServerError",
"message": "Index was outside the bounds of the array."
}
}