July 2nd, 2020

Breaking changes for Microsoft Teams beta APIs – permissions for installing personal apps, removing unused properties from code snippets

Nick Kramer (TEAMS)
Principal Product Manager

At the end of July, we will make the following changes to the beta endpoint. APIs on the v1.0 endpoint are not affected. Changes include:

  • Different permissions for app installations for a user – To improve security by running with least privilege, we have created new permission scopes for /users/{id}/teamwork/installedApps, and are dropping support for overly broad permissions. See below for details.
  • Removing redundant data from code snippets inside chatMessages – In order to simplify the developer experience and reduce payload size, we are removing some unused properties from code snippets. See below for details.

Different permissions for /users/{id}/teamwork/installedApps

We are removing support for User.Read.All, User.ReadWrite.All, Directory.Read.All, and Directory.ReadWrite.All permissions from these APIs:

GET /users/{id}/teamwork/installedApps
POST /users/{id}/teamwork/installedApps
DELETE /users/{id}/teamwork/installedApps/{id}
POST /users/{id}/teamwork/installedApps/{id}/upgrade

Instead, use one of these permissions:

  • TeamsAppInstallation.ReadForUser (delegated)
  • TeamsAppInstallation.ReadWriteForUser (delegated)
  • TeamsAppInstallation.ReadForUser.All (application)
  • TeamsAppInstallation.ReadWriteForUser.All (application)

Removing redundant data from code snippets inside chatMessages

Some chatMessages have code snippet cards inside them, embedded in the content property of an attachment. That content itself has a bunch of properties, we are removing some properties that are redundant.

For example, GET /teams/{id}/channels/{id}/messages/{id} returns something like this, we are simplifying the bolded part:

{
    “@odata.context”: “https://graph.microsoft.com/beta/$metadata#teams(‘bdb7bcda-9c3b-4341-b9a9-f52bf9a23407’)/channels(‘19%3A786524f437c042b68bac5c0511ad6be2%40thread.skype’)/messages/$entity”,
    “id”: “1584126765017”,
    “replyToId”: null,
    “etag”: “1584126765017”,
    “messageType”: “message”,
    “createdDateTime”: “2020-03-13T19:12:45.017Z”,
    “lastModifiedDateTime”: null,
    “deletedDateTime”: null,
    “subject”: null,
    “summary”: null,
    “importance”: “normal”,
    “locale”: “en-us”,
    “webUrl”: “https://teams.microsoft.com/l/message/19%3A786524f437c042b68bac5c0511ad6be2%40thread.skype/1584126765017?groupId=bdb7bcda-9c3b-4341-b9a9-f52bf9a23407&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&createdTime=1584126765017&parentMessageId=1584126765017”,
    “policyViolation”: null,
    “from”: {
        “application”: null,
        “device”: null,
        “conversation”: null,
        “user”: {
            “id”: “…”,
            “displayName”: “…”,
            “userIdentityType”: “aadUser”
        }
    },
    “body”: {
        “contentType”: “html”,
        “content”: “<div><div>Test</div>\n\n<div>&nbsp;</div>\n\n<div><attachment id=\”8c984810e000471c80fe624a2755444f\”></attachment></div>\n</div>”
    },
    “attachments”: [
        {
            “id”: “8c984810e000471c80fe624a2755444f”,
            “contentType”: “application/vnd.microsoft.card.codesnippet”,
            “contentUrl”: null,
            “content”: “{\r\n  \”observers\”: [],\r\n  \”type\”: \”application/vnd.microsoft.card.codesnippet\”,\r\n  \”cardButtons\”: [],\r\n  \”tapButton\”: null,\r\n  \”cardSender\”: null,\r\n  \”replyChainId\”: \”\”,\r\n  \”conversationId\”: \”\”,\r\n  \”alwaysExpand\”: false,\r\n  \”viewOnly\”: false,\r\n  \”clientMessageId\”: \”\”,\r\n  \”serverMessageId\”: \”\”,\r\n  \”messageType\”: \”\”,\r\n  \”isInputExtension\”: false,\r\n  \”hasMentions\”: false,\r\n  \”handler\”: \”codeSnippetDialog_496bb293-6fa6-42c3-a2d8-521fcbd8afff\”,\r\n  \”editable\”: true,\r\n  \”id\”: \”8c984810e000471c80fe624a2755444f\”,\r\n  \”name\”: \”\”,\r\n  \”language\”: \”Text\”,\r\n  \”lines\”: 1,\r\n  \”cardClientId\”: \”8c984810e000471c80fe624a2755444f\”,\r\n  \”wrap\”: false,\r\n  \”codeSnippetUrl\”: \”https://graph.microsoft.com/beta/teams/bdb7bcda-9c3b-4341-b9a9-f52bf9a23407/channels/19:786524f437c042b68bac5c0511ad6be2@thread.skype/messages/1584126765017/hostedContents/aWQ9MC1jdXMtZDEtOGM4MzUzZjkzNjkxNTc2ZjRmMjJlZTRmYTFlMDA3OTYsdHlwZT0wLHVybD0=/$value\”\r\n}”,
            “name”: null,
            “thumbnailUrl”: null
        }
    ],
    “mentions”: [],
    “reactions”: []
}

Here’s what that bolded part looks like today when reformatted to be readable:

{
    “name”: “”,
    “language”: “Text”,
    “lines”: 8,
    “wrap”: false,
    “codeSnippetUrl”: “https://graph.microsoft.com/beta/chats/19:07ad17ad-ada5-4f1f-a650-7a963886a8a7_2de87aaf-844d-4def-9dee-2c317f0be1b3@unq.gbl.spaces/messages/1583878505774/hostedContents/aWQ9MC1jdXMtZDQtMmY0MTY0MmYwZmE1NGQ0MmYxMWY4Mjc3ZTk3NjA0YzAsdHlwZT0wLHVybD0=/$value” ,

    “observers”: [], // going away

    “type”: “application/vnd.microsoft.card.codesnippet”, // going away
    “cardButtons”: [], // going away
    “tapButton”: null, // going away
    “cardSender”: null, // going away
    “replyChainId”: “”, // going away
    “conversationId”: “”, // going away
    “alwaysExpand”: false, // going away
    “viewOnly”: false, // going away
    “clientMessageId”: “”, // going away
    “serverMessageId”: “”, // going away
    “messageType”: “”, // going away
    “isInputExtension”: false, // going away
    “hasMentions”: false, // going away
    “handler”: “codeSnippetDialog_c4f35431-2b9b-4158-aef4-b377bdc82357”, // going away
    “editable”: true, // going away
    “id”: “ddd76144c464484ba8c1f42975cfe1ac”, // going away
    “cardClientId”: “ddd76144c464484ba8c1f42975cfe1ac”  // going away
}

Here’s what it will look like after we remove the redundant fields:

{ “name”: “”, “language”: “Text”, “lines”: 8, “wrap”: false, “codeSnippetUrl”: “https://graph.microsoft.com/beta/chats/19:07ad17ad-ada5-4f1f-a650-7a963886a8a7_2de87aaf-844d-4def-9dee-2c317f0be1b3@unq.gbl.spaces/messages/1583878505774/hostedContents/aWQ9MC1jdXMtZDQtMmY0MTY0MmYwZmE1NGQ0MmYxMWY4Mjc3ZTk3NjA0YzAsdHlwZT0wLHVybD0=/$value” }

Tell us what you think

We welcome your feedback. If you have further questions, you can reach out to us on StackOverflow.

-Microsoft Teams

Author

Nick Kramer (TEAMS)
Principal Product Manager