Muokkaa

Jaa


teamsAppInstallation: upgrade

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Upgrade an app installation in the personal scope of the specified user to the latest version of the app.

Note: This API works differently in one or more national clouds. For details, see Microsoft Teams API implementation differences in national clouds.

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.ReadWriteSelfForUser TeamsAppInstallation.ManageSelectedForUser, TeamsAppInstallation.ReadWriteAndConsentForUser, TeamsAppInstallation.ReadWriteAndConsentSelfForUser, TeamsAppInstallation.ReadWriteForUser, TeamsAppInstallation.ReadWriteSelectedForUser
Delegated (personal Microsoft account) Not supported. Not supported.
Application TeamsAppInstallation.ReadWriteSelfForUser.All TeamsAppInstallation.ManageSelectedForUser.All, TeamsAppInstallation.ReadWriteAndConsentForUser.All, TeamsAppInstallation.ReadWriteAndConsentSelfForUser.All, TeamsAppInstallation.ReadWriteForUser.All, TeamsAppInstallation.ReadWriteSelectedForUser.All

HTTP request

POST /users/{user-id | user-principal-name}/teamwork/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 properties.

The following table shows the properties that can be used with this method.

Property Type Description
consentedPermissionSet teamsAppPermissionSet The set of resource-specific permissions to be consented to. Optional.

Note: The permissions consented to during the install must be the same as the resource-specific permissions present in the teamsAppDefinition of the app. To get the application and delegated resource-specific permissions, see Example 7. If only delegated resource-specific permissions are present in the teamsAppDefinition, then the permissions can be omitted from the request body.

Response

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

Examples

Example 1: Upgrade a specific app installed for a user

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/users/5b649834-7412-4cce-9e69-176e95a394f5/teamwork/installedApps/NWI2NDk4MzQtNzQxMi00Y2NlLTllNjktMTc2ZTk1YTM5NGY1IyNhNmI2MzM2NS0zMWE0LTRmNDMtOTJlYy03MTBiNzE1NTdhZjk/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 the appCatalog. For details, see List apps installed in the personal scope of a user.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/users/5b649834-7412-4cce-9e69-176e95a394f5/teamwork/installedApps/NWI2NDk4MzQtNzQxMi00Y2NlLTllNjktMTc2ZTk1YTM5NGY1IyNhNmI2MzM2NS0zMWE0LTRmNDMtOTJlYy03MTBiNzE1NTdhZjk/upgrade
Content-Type: application/json

{
  "consentedPermissionSet": {
    "resourceSpecificPermissions": [
      {
        "permissionValue": "TeamsActivity.Send.User",
        "permissionType": "Application"
      }
    ]
  }
}

Response

The following example shows the response.

HTTP/1.1 204 No Content