命名空间:microsoft.graph
列出聊天中的所有应用安装。
注意:如果聊天与onlineMeeting实例关联,则实际上,将列出安装在会议中的teamsApp。
注意
teamsAppInstallation 资源的 id
与关联 teamsApp 资源的 id
具有不同的值。
此 API 可用于以下国家级云部署。
全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
✅ |
✅ |
✅ |
✅ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 |
最低特权权限 |
更高特权权限 |
委派(工作或学校帐户) |
TeamsAppInstallation.ReadForChat |
TeamsAppInstallation.ReadWriteSelfForChat、TeamsAppInstallation.ManageSelectedForChat、TeamsAppInstallation.ReadWriteAndConsentForChat、TeamsAppInstallation.ReadWriteAndConsentSelfForChat、TeamsAppInstallation.ReadWriteForChat |
委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
应用程序 |
TeamsAppInstallation.ReadForChat.All |
TeamsAppInstallation.ReadWriteSelfForChat.All, Chat.Manage.Chat、TeamsAppInstallation.ManageSelectedForChat.All、TeamsAppInstallation.Read.All、TeamsAppInstallation.Read.Chat、TeamsAppInstallation.ReadWriteAndConsentForChat.All、TeamsAppInstallation.ReadWriteAndConsentSelfForChat.All、TeamsAppInstallation.ReadWriteForChat.All |
注意
以下权限使用 特定于资源的许可:
- TeamsAppInstallation.ReadWriteAndConsentSelfForChat
- TeamsAppInstallation.ReadWriteAndConsentForChat
- TeamsAppInstallation.ReadWriteAndConsentSelfForChat.All
- TeamsAppInstallation.ReadWriteAndConsentForChat.All
HTTP 请求
GET /chats/{chat-id}/installedApps
可选的查询参数
此方法支持 $filter
、 $select
和 $expand
OData 查询参数 ,以帮助自定义响应。
标头 |
值 |
Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法将在响应正文中返回 200 OK
响应代码和 teamsAppInstallation 对象集合。
示例
示例 1:获取在指定聊天中安装的所有应用
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/chats/19%3Ad65713bc498c4a428c71ef9353e6ce20%40thread.v2/installedApps
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].InstalledApps.GetAsync();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
installedApps, err := graphClient.Chats().ByChatId("chat-id").InstalledApps().Get(context.Background(), nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppInstallationCollectionResponse result = graphClient.chats().byChatId("{chat-id}").installedApps().get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let installedApps = await client.api('/chats/19:d65713bc498c4a428c71ef9353e6ce20@thread.v2/installedApps')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->chats()->byChatId('chat-id')->installedApps()->get()->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.chats.by_chat_id('chat-id').installed_apps.get()
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats('19%3Ad65713bc498c4a428c71ef9353e6ce20%40thread.v2')/installedApps",
"value": [
{
"id": "MTk6ZDY1NzEzYmM0OThjNGE0MjhjNzFlZjkzNTNlNmNlMjBAdGhyZWFkLnYyIyMwMDAwMTAxNi1kZTA1LTQ5MmUtOTEwNi00ODI4ZmM4YTg2ODc="
},
{
"id": "MTk6ZDY1NzEzYmM0OThjNGE0MjhjNzFlZjkzNTNlNmNlMjBAdGhyZWFkLnYyIyMwZDgyMGVjZC1kZWYyLTQyOTctYWRhZC03ODA1NmNkZTdjNzg="
},
{
"id": "MTk6ZDY1NzEzYmM0OThjNGE0MjhjNzFlZjkzNTNlNmNlMjBAdGhyZWFkLnYyIyMxYzQzNDBkZS0yYTg1LTQwZTUtOGViMC00ZjI5NTM2ODk3OGI="
}
]
}
示例 2:获取在指定聊天中安装的应用的名称和其他详细信息
在下列示例中,如果已安装应用的实例有机器人与它相联系,那么该机器人的详细信息也会被返回。
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/chats/19%3Ad65713bc498c4a428c71ef9353e6ce20%40thread.v2/installedApps?$expand=teamsAppDefinition($expand=bot)
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].InstalledApps.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "teamsAppDefinition($expand=bot)" };
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc chats installed-apps list --chat-id {chat-id} --expand "teamsAppDefinition(\$expand=bot)"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphchats "github.com/microsoftgraph/msgraph-sdk-go/chats"
//other-imports
)
requestParameters := &graphchats.ItemInstalledAppsRequestBuilderGetQueryParameters{
Expand: [] string {"teamsAppDefinition($expand=bot)"},
}
configuration := &graphchats.ItemInstalledAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
installedApps, err := graphClient.Chats().ByChatId("chat-id").InstalledApps().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppInstallationCollectionResponse result = graphClient.chats().byChatId("{chat-id}").installedApps().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"teamsAppDefinition($expand=bot)"};
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let installedApps = await client.api('/chats/19:d65713bc498c4a428c71ef9353e6ce20@thread.v2/installedApps')
.expand('teamsAppDefinition($expand=bot)')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Chats\Item\InstalledApps\InstalledAppsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new InstalledAppsRequestBuilderGetRequestConfiguration();
$queryParameters = InstalledAppsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->expand = ["teamsAppDefinition(\$expand=bot)"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->chats()->byChatId('chat-id')->installedApps()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Teams
Get-MgChatInstalledApp -ChatId $chatId -ExpandProperty "teamsAppDefinition(`$expand=bot)"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.chats.item.installed_apps.installed_apps_request_builder import InstalledAppsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = InstalledAppsRequestBuilder.InstalledAppsRequestBuilderGetQueryParameters(
expand = ["teamsAppDefinition($expand=bot)"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.chats.by_chat_id('chat-id').installed_apps.get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats('19%3Ad65713bc498c4a428c71ef9353e6ce20%40thread.v2')/installedApps(teamsAppDefinition())",
"value": [
{
"id": "MTk6ZDY1NzEzYmM0OThjNGE0MjhjNzFlZjkzNTNlNmNlMjBAdGhyZWFkLnYyIyMwMDAwMTAxNi1kZTA1LTQ5MmUtOTEwNi00ODI4ZmM4YTg2ODc=",
"teamsAppDefinition": {
"id": "MDAwMDEwMTYtZGUwNS00OTJlLTkxMDYtNDgyOGZjOGE4Njg3IyMxLjAuMiMjUHVibGlzaGVk",
"teamsAppId": "00001016-de05-492e-9106-4828fc8a8687",
"azureADAppId": "7df0a125-d3be-4c96-aa54-591f83ff541c",
"displayName": "Power Automate Actions",
"version": "1.0.2",
"requiredResourceSpecificApplicationPermissions": [],
"publishingState": "published",
"shortdescription": "Be more productive with Microsoft Flow",
"description": "Automate time-consuming and repetitive tasks by integrating your favorite apps and services with Microsoft Power Automate.",
"lastModifiedDateTime": null,
"createdBy": null,
"bot": {
"id":"9a58a3ec-6b68-4818-ac11-844f1c326784"
}
}
},
{
"id": "MTk6ZDY1NzEzYmM0OThjNGE0MjhjNzFlZjkzNTNlNmNlMjBAdGhyZWFkLnYyIyMwZDgyMGVjZC1kZWYyLTQyOTctYWRhZC03ODA1NmNkZTdjNzg=",
"teamsAppDefinition": {
"id": "MGQ4MjBlY2QtZGVmMi00Mjk3LWFkYWQtNzgwNTZjZGU3Yzc4IyMxLjAuMCMjUHVibGlzaGVk",
"teamsAppId": "0d820ecd-def2-4297-adad-78056cde7c78",
"azureADAppId": "2d4d3d8e-2be3-4bef-9f87-7875a61c29de",
"displayName": "OneNote",
"version": "1.0.0",
"requiredResourceSpecificApplicationPermissions": [],
"publishingState": "published",
"shortdescription": "Capture and share ideas, to-do lists and other notes with your team.",
"description": "Capture and share ideas, to-do lists and other thoughts with your team. You can also co-author anytime.",
"lastModifiedDateTime": null,
"createdBy": null
}
},
{
"id": "MTk6ZDY1NzEzYmM0OThjNGE0MjhjNzFlZjkzNTNlNmNlMjBAdGhyZWFkLnYyIyMxYzQzNDBkZS0yYTg1LTQwZTUtOGViMC00ZjI5NTM2ODk3OGI=",
"teamsAppDefinition": {
"id": "MWM0MzQwZGUtMmE4NS00MGU1LThlYjAtNGYyOTUzNjg5NzhiIyMxLjMjI1B1Ymxpc2hlZA==",
"teamsAppId": "1c4340de-2a85-40e5-8eb0-4f295368978b",
"azureADAppId": null,
"displayName": "Power BI",
"version": "1.3",
"requiredResourceSpecificApplicationPermissions": [],
"publishingState": "published",
"shortdescription": "Easily see and chat about Power BI reports",
"description": "Pin Power BI reports to your channel to start a conversation about your data. With reports and chats in the same place, everyone stays on the same page.",
"lastModifiedDateTime": null,
"createdBy": null
}
}
]
}
示例 3:基于关联应用的清单 id 获取应用安装资源
请求
以下示例显示了一个请求。 在此示例中,Teams 应用的清单 ID 为“cf1ba4c7-f94e-4d80-ba90-5594b641a8ee”。
GET https://graph.microsoft.com/v1.0/chats/19%3Ad65713bc498c4a428c71ef9353e6ce20%40thread.v2/installedApps?$expand=teamsApp,teamsAppDefinition&$filter=teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].InstalledApps.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "teamsApp","teamsAppDefinition" };
requestConfiguration.QueryParameters.Filter = "teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc chats installed-apps list --chat-id {chat-id} --filter "teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'" --expand "teamsApp,teamsAppDefinition"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphchats "github.com/microsoftgraph/msgraph-sdk-go/chats"
//other-imports
)
requestFilter := "teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'"
requestParameters := &graphchats.ItemInstalledAppsRequestBuilderGetQueryParameters{
Expand: [] string {"teamsApp","teamsAppDefinition"},
Filter: &requestFilter,
}
configuration := &graphchats.ItemInstalledAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
installedApps, err := graphClient.Chats().ByChatId("chat-id").InstalledApps().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppInstallationCollectionResponse result = graphClient.chats().byChatId("{chat-id}").installedApps().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"teamsApp", "teamsAppDefinition"};
requestConfiguration.queryParameters.filter = "teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let installedApps = await client.api('/chats/19:d65713bc498c4a428c71ef9353e6ce20@thread.v2/installedApps')
.filter('teamsApp/externalId eq \'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee\'')
.expand('teamsApp,teamsAppDefinition')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Chats\Item\InstalledApps\InstalledAppsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new InstalledAppsRequestBuilderGetRequestConfiguration();
$queryParameters = InstalledAppsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->expand = ["teamsApp","teamsAppDefinition"];
$queryParameters->filter = "teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->chats()->byChatId('chat-id')->installedApps()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Teams
Get-MgChatInstalledApp -ChatId $chatId -ExpandProperty "teamsApp,teamsAppDefinition" -Filter "teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.chats.item.installed_apps.installed_apps_request_builder import InstalledAppsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = InstalledAppsRequestBuilder.InstalledAppsRequestBuilderGetQueryParameters(
expand = ["teamsApp","teamsAppDefinition"],
filter = "teamsApp/externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.chats.by_chat_id('chat-id').installed_apps.get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.count": 1,
"value": [
{
"id": "NjkwM2ZhOTMtNjA1Yi00M2VmLTkyMGUtNzdjNDcyOWY4MjU4IyMwMjQwYTM2OC0yNWUwLTQ1NjktOGViZS0xMzYwMWNiNTVhMTg=",
"teamsApp": {
"id": "0240a368-25e0-4569-8ebe-13601cb55a18",
"externalId": "cf1ba4c7-f94e-4d80-ba90-5594b641a8ee",
"displayName": "YPA",
"distributionMethod": "sideloaded"
},
"teamsAppDefinition": {
"id": "MDI0MGEzNjgtMjVlMC00NTY5LThlYmUtMTM2MDFjYjU1YTE4IyM2LjAuMA==",
"teamsAppId": "0240a368-25e0-4569-8ebe-13601cb55a18",
"azureADAppId": "9fc97ea2-c417-4c76-a2db-197612067b28",
"displayName": "YPA",
"version": "6.0.0",
"requiredResourceSpecificApplicationPermissions": [
],
"publishingState": "published",
"shortdescription": "A conversational smart assistant from MSX that surfaces real-time insights.",
"description": "For MSX Users: A conversational role-based smart assistant that will enable Enterprise sellers (AE, ATS, SSP, TSP) to be more productive by surfacing real-time insights, recommendations, actions and notifications, and by automating repetitive tasks.",
"lastModifiedDateTime": null,
"createdBy": null
}
}
]
}
示例 4:获取为指定聊天中安装的应用许可的资源特定权限集
以下示例获取在安装过程中 授予应用的任何特定于资源的权限 的列表。 需要查询 $select
参数才能显示已同意的权限集。
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/chats/19%5bd86ec7f6b247d3b9e519b0bfef5d03%40thread.v2/installedApps?$select=consentedPermissionSet,id
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].InstalledApps.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "consentedPermissionSet","id" };
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc chats installed-apps list --chat-id {chat-id} --select "consentedPermissionSet,id"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphchats "github.com/microsoftgraph/msgraph-sdk-go/chats"
//other-imports
)
requestParameters := &graphchats.ItemInstalledAppsRequestBuilderGetQueryParameters{
Select: [] string {"consentedPermissionSet","id"},
}
configuration := &graphchats.ItemInstalledAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
installedApps, err := graphClient.Chats().ByChatId("chat-id").InstalledApps().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppInstallationCollectionResponse result = graphClient.chats().byChatId("{chat-id}").installedApps().get(requestConfiguration -> {
requestConfiguration.queryParameters.select = new String []{"consentedPermissionSet", "id"};
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let installedApps = await client.api('/chats/19[d86ec7f6b247d3b9e519b0bfef5d03@thread.v2/installedApps')
.select('consentedPermissionSet,id')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Chats\Item\InstalledApps\InstalledAppsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new InstalledAppsRequestBuilderGetRequestConfiguration();
$queryParameters = InstalledAppsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->select = ["consentedPermissionSet","id"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->chats()->byChatId('chat-id')->installedApps()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Teams
Get-MgChatInstalledApp -ChatId $chatId -Property "consentedPermissionSet,id"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.chats.item.installed_apps.installed_apps_request_builder import InstalledAppsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = InstalledAppsRequestBuilder.InstalledAppsRequestBuilderGetQueryParameters(
select = ["consentedPermissionSet","id"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.chats.by_chat_id('chat-id').installed_apps.get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/chats('19%3A5bd86ec7f6b247d3b9e519b0bfef5d03%40thread.v2')/installedApps(consentedPermissionSet,id)",
"value": [
{
"id": "MTk6NWJkODZlYzdmNmIyNDdkM2I5ZTUxOWIwYmZlZjVkMDNAdGhyZWFkLnYyIyM0ZTVhNmMzYy1jOTU5LTRiY2EtOGRiNy0wMGRiM2E0ODdjZTE=",
"consentedPermissionSet": {
"resourceSpecificPermissions": [
{
"permissionValue": "ChatMessage.Read.Chat",
"permissionType": "application"
}
]
}
},
{
"id": "MTk6NWJkODZlYzdmNmIyNDdkM2I5ZTUxOWIwYmZlZjVkMDNAdGhyZWFkLnYyIyMyYjUyNGUyOC05NWNlLTRjOWItOTc3My00YTViZDZlYzE3NzA=",
"consentedPermissionSet": {
"resourceSpecificPermissions": [
{
"permissionValue": "OnlineMeeting.ReadBasic.Chat",
"permissionType": "delegated"
},
{
"permissionValue": "OnlineMeetingIncomingAudio.Detect.Chat",
"permissionType": "delegated"
}
]
}
}
]
}
相关内容