Skip to content

Latest commit

 

History

History
208 lines (151 loc) · 7.87 KB

File metadata and controls

208 lines (151 loc) · 7.87 KB
title Install app for user
description Install an app in the personal scope of the specified user.
author akjo
doc_type apiPageType
ms.localizationpriority medium
ms.subservice teams
ms.date 04/04/2024

Install app for user

Namespace: microsoft.graph

Install an app in the personal scope of the specified user.

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

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

Note

If you want your app to install, get, upgrade, or remove an app for the user, you must use the TeamsAppInstallation.ReadWriteForUser permission.

HTTP request

POST /users/{user-id | user-principal-name}/teamwork/installedApps

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-type application/json. Required.

Request body

The request body should contain the catalog generated app ID for the app catalog. For details, see teamsApp properties. The following table lists additional parameters that can be used with the request body.

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

Note: The permissions consented to during the install must be same as the resource-specific permissions present in the teamsAppDefinition of the app. To get the application and delegated resource-specific permissions, see List apps installed in the personal scope of a user. If only delegated resource-specific permissions are present in teamsAppDefinition, permissions can be omitted in the body of this request.

Response

If successful, this method returns a 201 Created response code. It doesn't return anything in the response body.

Examples

Example 1: Install an app for a user

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/users/5b649834-7412-4cce-9e69-176e95a394f5/teamwork/installedApps
Content-type: application/json

{
   "teamsApp@odata.bind":"https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/12345678-9abc-def0-123456789a"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 201 Created

Example 2: Install an app for a user and consent to the resource-specific permissions required by the app

Request

The following example shows a request.

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

{
  "teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/12345678-9abc-def0-123456789a",
  "consentedPermissionSet": {
    "resourceSpecificPermissions": [
      {
        "permissionValue": "TeamsActivity.Send.User",
        "permissionType": "Application"
      }
    ]
  }
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 201 Created

Related content

Microsoft Graph service-specific throttling limits