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
Related
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"
}
}
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.
Created an Event with Microsoft Graph:
{
"subject": "TEST",
"body": {
"contentType": "HTML",
"content": "test event respond"
},
"start": {
"dateTime": "2019-05-22T00:00:00",
"timeZone": "Asia/Kolkata"
},
"end": {
"dateTime": "2019-05-22T00:00:00",
"timeZone": "Asia/Kolkata"
},
"location": { "displayName": "Leena AI" },
"attendees": [
{
"emailAddress": {
"address": "sachin#live.com",
"name": "Sachin Goel"
},
"type": "optional"
}
],
"isReminderOn": false,
"reminderMinutesBeforeStart": 15
}
If I try to accept the event from sachin#live.com user it throws an error:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store.",
"innerError": {
"request-id": "485528b0-dbbe-42f5-80c0-5fc91477fc31",
"date": "2019-04-30T07:11:58"
}
}
}
sample request:
https://graph.microsoft.com/v1.0/me/events/{eventId}/accept
{
"comment" : "respond from api"
}
It results in NotFoundError but this works from UI. I have tried different solution (updating permission, primary calendar) but nothing works
Are there any constraints with this flow at the API level?
The Event ID for the Event you created in your mailbox is not going to be the same as the Event ID in the sachin#live.com mailbox.
You need to find the message with the sachin#live.com mailbox and then accept that id.
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
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."
}
}