MSGraph findMeetingTimes API return 500 Error - microsoft-graph-api

I am using the graph API's findmeetingTimes to get free/busy time.
If there is an event set in seconds in the time range within the range specified by the Timeslots parameter,500 error will be returned
For example, if I send following request :
POST https://graph.microsoft.com/v1.0/me/findMeetingTimes
{
"attendees": [],
"timeConstraint": {
"timeslots": [
{
"start": {
"dateTime": "2018-07-19T09:00:00.000Z",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-07-19T21:00:00.000Z",
"timeZone": "UTC"
}
}
]
},
"meetingDuration": "PT1H"
}
API returns following RESPONSE :
{
"error": {
"code": "ErrorInternalServerError",
"message": "An internal server error occurred. The operation failed.",
"innerError": {
"request-id": "43a1699f-2241-4c59-8450-826612466f07",
"date": "2018-07-19T02:16:22"
}
}
}
This is my Calencar(Only 1 event on July 19, 2018)
Get https://graph.microsoft.com/v1.0/me/calendarview?startdatetime=2018-07-19T00:00:00.000Z&enddatetime=2018-07-19T23:59:59.999Z
・
・
・
"start": {
"dateTime": "2018-07-19T12:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-07-19T12:33:33.0000000",
"timeZone": "UTC"
}
・
・
・
It also happens with outlookAPI
This seems like a bug to me.
Is this a known bug, and are there any plans to fix it?
Is there a known work around?

Try changing the timezone label in the time slot, UTC doesn't seem to work for some reason. At this point it's not clear whether it's a gap in the documentation or an issue with the API itself.
I opened a GitHub Issue to have Microsoft investigate

Related

Controlling internal and external autoreplies

When I set mailboxsettigs|automaticRepliesSetting|status using MSGraph (for a shared mailbox) it seems to only affect the setting for internal recipients and there seems no syntax for dealing with internal/external recipients. What am I missing?
For external recipients you need to also set externalAudience to all.
PATCH /users/{id}/mailboxSettings
"automaticRepliesSetting": {
"status": "scheduled",
"externalAudience": "all",
"scheduledStartDateTime": {
"dateTime": "2023-02-15T02:00:00.0000000",
"timeZone": "UTC"
},
"scheduledEndDateTime": {
"dateTime": "2023-02-16T02:00:00.0000000",
"timeZone": "UTC"
},
"internalReplyMessage": "<html>\n<body>\n<p>I'm out<br>\n</p></body>\n</html>\n",
"externalReplyMessage": "<html>\n<body>\n<p>I'm out<br>\n</p></body>\n</html>\n"
}

With Exchange Web Services a calendar event can be created and assigned to a specific category while that same capability is missing from Graph

I have been using EWS to create appointments in both Exchange on-premise and Exchange online mailboxes that include a category value. I'm trying to migrate to Microsoft Graph since it's the recommended path according to Microsoft https://learn.microsoft.com/en-us/graph/migrate-exchange-web-services-overview
One of the EWS capabilities I can't replicate is creating a calendar event with a category.
The EWS Appointment class supports setting the category for the appointment - https://learn.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data.appointment?view=exchange-ews-api
When testing with Graph to create a calendar event, all responses to the posted requests include a null categories array as shown in the documentation - https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=csharp so it would seem that a request can be made with category.
Using the Microsoft Graph explorer to create a calendar event I naively add the categories property as an array and include a known category from the user's mailbox:
{
"subject": "Test",
"isAllDay": true,
"ShowAs":"Free",
"categories": [
{ "displayName":"Red Category", "color": "preset0" },
],
"start": {
"dateTime": "2022-11-08T00:00:00.0000000",
"timeZone": "Eastern Standard Time"
},
"end": {
"dateTime": "2022-11-09T00:00:00.0000000",
"timeZone": "Eastern Standard Time"
}
}
The response is always:
{
"error": {
"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize "
}
}
I have also changed the property to a key:value which gets the same reponse.
{
"subject": "Test",
"isAllDay": true,
"ShowAs":"Free",
"category": "Red Category",
"start": {
"dateTime": "2022-11-08T00:00:00.0000000",
"timeZone": "Eastern Standard Time"
},
"end": {
"dateTime": "2022-11-09T00:00:00.0000000",
"timeZone": "Eastern Standard Time"
}
}
Does the Graph Create Event POST /users/{id | userPrincipalName}/calendars/{id}/events support including a category?
You were so close.
Categories is an array of strings. This will create the appointment with the Personal category, if there is no Personal category one will be created.
{
"subject": "Test",
"isAllDay": true,
"ShowAs": "Free",
"categories": [
"Personal"
],
"start": {
"dateTime": "2022-11-08T00:00:00.0000000",
"timeZone": "Eastern Standard Time"
},
"end": {
"dateTime": "2022-11-09T00:00:00.0000000",
"timeZone": "Eastern Standard Time"
}
}

Which property is used to determin whether to allow forwarding an event message in graph api?

When I get a Message or Event object, I don't see any property that seems to be related to AllowForward. Tried both v1.0 and beta.
There is no strongly typed property so you need to use the Extended property for this eg to send a Meeting with no forward
{
"subject": "My event",
"start": {
"dateTime": "2020-10-13T04:55:36.463Z",
"timeZone": "UTC"
},
"end": {
"dateTime": "2020-10-20T04:55:36.463Z",
"timeZone": "UTC"
},
"attendees": [
{
"emailAddress": {
"address":"blah#domain.com",
"name": "gs"
},
"type": "required"
}
],
"SingleValueExtendedProperties": [
{
"PropertyId": "Boolean {00020329-0000-0000-C000-000000000046} Name DoNotForward",
"Value": "true"
}
]
}
Then to retrieve that property with an event use
https://graph.microsoft.com/v1.0/me/events?$expand=SingleValueExtendedProperties($filter%20%3D%20(id%20eq%20'Boolean%20%7B00020329-0000-0000-C000-000000000046%7D%20Name%20DoNotForward'))

Microsoft Graph API creating recurring event returns 500

I'm writing an app that synchronizes with Office365's events using the Microsoft Graph API v1.0.
When creating a single event, the event gets created as expected:
Response Status Code: 201 Created
Request URL: https://graph.microsoft.com/v1.0/me/calendars/<myCalendarId>/events
Request Method: POST
Request Payload:
{
"subject": "single event",
"start": {
"dateTime": "2020-02-15T09:00:00",
"timeZone": "Europe/Berlin"
},
"end": {
"dateTime": "2020-02-15T10:00:00",
"timeZone": "Europe/Berlin"
},
"attendees": [],
"type": "singleInstance",
"location": {
"displayName": null
},
"recurrence": null
}
If, however, I send a create request for a recurring event, I get a error response.
Response Status Code: 500 Internal Server Error
Request URL: https://graph.microsoft.com/v1.0/me/calendars/<myCalendarId>/events
Request Method: POST
Request Payload:
{
"subject": "test recurring event",
"start": {
"dateTime": "2020-02-14T09:00:00",
"timeZone": "Europe/Berlin"
},
"end": {
"dateTime": "2020-02-14T10:00:00",
"timeZone": "Europe/Berlin"
},
"attendees": [],
"location": {
"displayName": null
},
"recurrence": {
"pattern": {
"daysOfWeek": [],
"type": "daily"
},
"range": {
"numberOfOccurrences": "2",
"recurrenceTimeZone": "Europe/Berlin",
"startDate": "2020-02-14",
"type": "numbered"
}
}
}
Response Body:
{
"error": {
"code": "ErrorInternalServerError",
"message": "An internal server error occurred. The operation failed.",
"innerError": {
"request-id": "2d97931c-e08c-45a8-8167-5849df53a694",
"date": "2020-02-14T14:38:28"
}
}
}
I find it strange that the addition of the recurrence settings causes an Internal Server Error.
What can I do to create a recurring event with the API?
If you want to create a recurring event that occurs daily, instead of setting pattern in the following way:
"pattern": {
"daysOfWeek": [],
"type": "daily"
},
Please set pattern this way:
"pattern": {
"type": "daily",
"interval": 1
},
Creating a daily recurrence pattern is described here in the conceptual docs. Within the next day, there will also be a REST example in the reference docs.

Microsoft Graph findMeetingTimes throws ErrorInternalServerError

When looking for an available meeting time the server returns a 500 without further explanation.
Request: POST https://graph.microsoft.com/v1.0/me/findMeetingTimes
{
"locationConstraint": {
"isRequired": "true",
"suggestLocation": "false",
"locations": [
{
"resolveAvailability": "true",
"locationEmailAddress": "..."
}
]
},
"timeConstraint": {
"activityDomain":"unrestricted",
"timeslots": [
{
"start": {
"dateTime": "2018-08-24T16:00:00",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-08-24T23:59:59",
"timeZone": "UTC"
}
}
]
}
}
Response:
{
"error": {
"code": "ErrorInternalServerError",
"message": "An internal server error occurred. The operation failed.",
"innerError": {
"request-id": "9e628ded-5750-497e-b54e-efe9b7184403",
"date": "2018-08-24T16:35:30"
}
}
}
It seems findMeetingTimes can't handle meetings which have a start or end dateTime with milliseconds. Also seconds need to be truncated to 00.
Works
"dateTime": "2018-08-24T16:00:00",
Breaks findMeetingTimes
"dateTime": "2018-08-24T16:00:00.791",
According to your descriptions, I suppose you want to look for an available meeting time.
Base on my test, If we set the value of the “start to end” time is less than the value of 'meetingDuration' Field. I got same error as you described.
If no meeting duration is specified, findMeetingTimes uses the default of 30 minutes.
From test above, we should set value of “start to end” time greater than the value of the 'meetingDuration' Field. Or greater than 30 if 'meetingDuration' was no set (because by default it will be 30 minutes

Resources