編輯

共用方式為


teamsAppInstallation in a team: upgrade

Namespace: microsoft.graph

Upgrade an app installation in a team to the latest version of the app.

Note:

  • Currently, upgrading an app that requires resource-specific consent permissions is not supported in an application context.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) TeamsAppInstallation.ReadWriteSelfForTeam Directory.ReadWrite.All, Group.ReadWrite.All, TeamsAppInstallation.ManageSelectedForTeam, TeamsAppInstallation.ReadWriteAndConsentForTeam, TeamsAppInstallation.ReadWriteAndConsentSelfForTeam, TeamsAppInstallation.ReadWriteForTeam
Delegated (personal Microsoft account) Not supported. Not supported.
Application TeamsAppInstallation.ReadWriteSelfForTeam.All Directory.ReadWrite.All, Group.ReadWrite.All, TeamsAppInstallation.ManageSelectedForTeam.All, TeamsAppInstallation.ReadWriteAndConsentForTeam.All, TeamsAppInstallation.ReadWriteAndConsentSelfForTeam.All, TeamsAppInstallation.ReadWriteForTeam.All

Note

  • The TeamsAppInstallation.ReadWriteSelfForTeam, TeamsAppInstallation.ReadWriteForTeampermissions, TeamsAppInstallation.ReadWriteSelfForTeam.All, and TeamsAppInstallation.ReadWriteForTeam.All permissions cannot be used to install apps that require consent to resource-specific consent permissions.
  • The Group.ReadWrite.All and Directory.ReadWrite.All permissions are supported only for backward compatibility. We recommend that you update your solutions to use an alternative permission and avoid using these permissions going forward.

HTTP request

POST /teams/{team-id}/installedApps/{app-installation-id}/upgrade

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

In the request body, supply a JSON representation of the parameters.

The following table shows more parameters that can be used with the upgrade action.

Parameter Type Description
consentedPermissionSet teamsAppPermissionSet Set of resource specific permissions that are being consented.

Note: The permissions consented to during the installation must match the resource-specific permissions specified in the teamsAppDefinition of the app. To get the application and delegated resource-specific permissions, see Example 6. If only delegated resource-specific permissions are specified in the teamsAppDefinition, permissions can be omitted in the request body.

Response

If successful, this method returns 204 No Content response code. It doesn't return anything in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/teams/db5e04be-daa2-4a35-beb1-5e73cc381599/installedApps/NjkwM2ZhOTMtNjA1Yi00M2VmLTkyMGUtNzdjNDcyOWY4MjU4IyMwMjQwYTM2OC0yNWUwLTQ1NjktOGViZS0xMzYwMWNiNTVhMTg=/upgrade

{

}

Response

The following example shows the response.

HTTP/1.1 204 No Content

To get the list of resource-specific permissions required by the app, get the app from appCatalog, as shown in Example 6.

Request

POST https://graph.microsoft.com/v1.0/teams/20988f0f-a647-42f6-be30-79e04de3c2ed/installedApps/MjA5ODhmMGYtYTY0Ny00MmY2LWJlMzAtNzllMDRkZTNjMmVkIyNmYTkzN2Y4OS1iYWNhLTQ5NzktYmY4YS00MmY5ODE5MWY3ODA=/upgrade
Content-Type: application/json

{
  "consentedPermissionSet": {
    "resourceSpecificPermissions": [
      {
        "permissionValue": "Channel.Create.Group",
        "permissionType": "application"
      },
      {
        "permissionValue": "ChannelMeeting.ReadBasic.Group",
        "permissionType": "delegated"
      }
    ]
  }
}

Response

HTTP/1.1 204 No Content