"Overlaps are not supported within TimeSlots" error in Outlook Calendar REST API - office365api

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."
}
}

Related

Configuring activity types in a Microsoft teams app

I have sideloaded a teams app with an activity type, so that I could I could use the activity feed graph api. However, when I send a teams/<teamId>/sendActivityNotification request, I get 501 "Not Implemented". There are no specifics in the response.
{ "error": { "code": "NotImplemented", "message": "Failed to process request.", "innerError": { "date": "2021-04-16T07:48:31", "request-id": "bd92c3a5-9ec5-49a1-a2d5-057f7dd3c182", "client-request-id": "bd92c3a5-9ec5-49a1-a2d5-057f7dd3c182" } }}
I think I may be missing something about how graph API integrates with teams apps.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"id": "<APP_ID>",
"version": "1.0",
"packageName": "com.nikita",
"developer": {
"name": "Nikita Cool Dude",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://www.microsoft.com",
"termsOfUseUrl": "https://www.microsoft.com"
},
"name": {
"full": "MMM service test",
"short": "MMM service test"
},
"accentColor": "#FFFFFF",
"description": {
"full": "Packages mmm activity types.",
"short": "Packages mmm activity types."
},
"icons": {
"outline": "mmm-small.png",
"color": "mmm-small.png"
},
"activities": {
"activityTypes": [
{
"type": "mmmChannelCreated",
"description": "New channel is created for an mmm event",
"templateText": "New <priority> <cfs> event"
}
]
},
"connectors": [
{
"connectorId": "<APP_ID>",
"scopes": ["team"]
}
]
}
Note that I am adding a connector I'm not using. Otherwise I get Error while reading manifest.json: "configurableTabs, staticTabs, bots, connectors, or composeExtensions" is required error when sideloading the app. The app id is created through portal.azure.com.
Below is the request payload, in case that is relevant. I based it very closely on examples in the graph API documentation.
{
"topic": {
"source": "entityUrl",
"value": "https://graph.microsoft.com/v1.0/teams/<teamId>/channels/<channelId>",
},
"activityType": "mmmChannelCreated",
"previewText": {
"content": "New important event!"
},
"templateParameters": [
{
"name": "priority",
"value": "P1"
},
{
"name": "cfs",
"value": "Armed Robbery"
}
]
}
Any ideas are appreciated!
In your manifest webApplicationInfo section is missing. The Teams app manifest must have the Azure AD app ID added to the webApplicationInfo section. Follow the requirements provided in documetation to use sendActivityNotification.

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.

Pull Request Statuses - Added custom properties to a status aren't getting persisted by TFS

We are operating a TFS 2018 Update 2 in our enviroment.
We are sending the example json found here to our server and it is getting accepted successfully:
{
"properties": {
"sampleId": 7,
"customInfo": "Custom status information",
"startedDateTime": {
"$type": "System.DateTime",
"$value": "2017-09-19T14:50:26.7410146Z"
},
"weight": {
"$type": "System.Double",
"$value": 1.75
},
"bytes": {
"$type": "System.Byte[]",
"$value": "dGhpcyBpcyBzYW1wbGUgYmFzZTY0IGVuY29kZWQgc3RyaW5n"
},
"globalId": {
"$type": "System.Guid",
"$value": "1e788cb9-9d3d-4dc6-ac05-822092d17f90"
}
},
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}
But the response doesn't look like in the documentation. Instead it looks like this:
{
"id": 6,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"creationDate": "2019-12-11T16:14:05.0574648Z",
"updatedDate": "2019-12-11T16:14:05.0574648Z",
"createdBy": {
"displayName": "...",
"url": "https://.../_apis/Identities/0b85e078-130d-4cb8-a450-17c5c7efccec",
"_links": {
"avatar": {
"href": "https://.../_api/_common/identityImage?id=0b85e078-130d-4cb8-a450-17c5c7efccec"
}
},
"id": "0b85e078-130d-4cb8-a450-17c5c7efccec",
"uniqueName": "...",
"imageUrl": "https://.../_api/_common/identityImage?id=0b85e078-130d-4cb8-a450-17c5c7efccec"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1",
"_links": {
"self": {
"href": "https://.../_apis/git/repositories/35fe73eb-7af1-4bba-bf04-545611fcac1d/pullRequests/58/statuses/6"
},
"repository": {
"href": "https://.../_apis/git/repositories/35fe73eb-7af1-4bba-bf04-545611fcac1d"
}
}
}
The properties are gone. What could be wrong?
Could it be a somehow completely missleading documentation?
To troubleshoot your issue, please check the following items:
Check whether the Status updated on the pull request after running the POST request.
Press F12 in your browser, and send the POST request to check the statuses to see whether you can get properties in the response body.
Check your TFS edition by going to Administration Console -- Application Tier, or checking the About on the web portal. The issue can not be reproduced in TFS 2018.2 on our side.

Outlook event RSVP graph api issue

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.

Creating event returns ErrorPropertyValidationFailure

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.

Resources