列出 teamsApp
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
列出Microsoft Teams 应用目录中的应用。
这包括来自Microsoft Teams存储的应用,以及组织应用目录中的应用 (租户应用目录) 。 若要仅从组织的应用目录中获取应用,请在请求中指定 organization 为 distributionMethod 。
备注
id teamsApp 资源由服务器生成,与Teams应用清单中指定的资源不同id。 开发id人员作为Teams应用清单的一部分提供的标记为 externalId teamsApp 资源中的标记。
权限
需要以下权限之一才能调用此 API。要了解包括如何选择权限的详细信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
AppCatalog.Submit、AppCatalog.Read.All、AppCatalog.ReadWrite.All、Directory.Read.All 、Directory.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
AppCatalog.Read.All、AppCatalog.ReadWrite.All
Note : 仅支持使用 ** 标记的权限以实现向后兼容。 建议更新解决方案,以使用上表中列出的替代权限,并避免今后使用这些权限。
HTTP 请求
GET /appCatalogs/teamsApps
可选的查询参数
此方法支持使用 $filter、$select 和$expand OData 查询参数 来帮助自定义响应。
Using $expand=AppDefinitions 将返回有关应用状态的详细信息,例如 publishingState ,它反映应用提交评审状态,并返回应用是否已获得批准、拒绝或仍在审查中。
注意: 可以筛选 teamsApp 对象的任何字段,以缩短结果列表。 可以使用以下任一筛选器操作:等于、不等于、或不等于。
标头
值
Authorization
Bearer {token}。必需。
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回 200 OK 响应代码和 teamsApp 对象列表。
示例
示例 1:列出特定于租户的所有应用程序
以下示例列出了特定于租户的所有应用程序。
请求
GET https://graph.microsoft.com/beta/appCatalogs/teamsApps?$filter=distributionMethod eq 'organization'
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var teamsApps = await graphClient.AppCatalogs.TeamsApps
.Request()
.Filter("distributionMethod eq 'organization'")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let teamsApps = await client.api('/appCatalogs/teamsApps')
.version('beta')
.filter('distributionMethod eq \'organization\'')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/appCatalogs/teamsApps?$filter=distributionMethod%20eq%20'organization'"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphTeamsApp *teamsApp = [[MSGraphTeamsApp alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
TeamsAppCollectionPage teamsApps = graphClient.appCatalogs().teamsApps()
.buildRequest()
.filter("distributionMethod eq 'organization'")
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.TeamsAppsRequestBuilderGetQueryParameters{
Filter: "distributionMethod%20eq%20'organization'",
}
options := &msgraphsdk.TeamsAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.AppCatalogs().TeamsApps().GetWithRequestConfigurationAndResponseHandler(options, nil)
Import-Module Microsoft.Graph.Teams
Get-MgAppCatalogTeamApp -Filter "distributionMethod eq 'organization'"
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"id": "b1c5353a-7aca-41b3-830f-27d5218fe0e5",
"externalId": "f31b1263-ba99-435a-a679-911d24850d7c",
"name": "Test App",
"version": "1.0.1",
"distributionMethod": "Organization"
}
]
}
示例 2:列出具有给定 ID 的应用程序
以下示例列出了具有给定 ID 的应用程序。
请求
GET https://graph.microsoft.com/beta/appCatalogs/teamsApps?$filter=id%20eq%20'b1c5353a-7aca-41b3-830f-27d5218fe0e5'
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var teamsApps = await graphClient.AppCatalogs.TeamsApps
.Request()
.Filter("id eq 'b1c5353a-7aca-41b3-830f-27d5218fe0e5'")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let teamsApps = await client.api('/appCatalogs/teamsApps')
.version('beta')
.filter('id eq \'b1c5353a-7aca-41b3-830f-27d5218fe0e5\'')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/appCatalogs/teamsApps?$filter=id%20eq%20'b1c5353a-7aca-41b3-830f-27d5218fe0e5'"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphTeamsApp *teamsApp = [[MSGraphTeamsApp alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
TeamsAppCollectionPage teamsApps = graphClient.appCatalogs().teamsApps()
.buildRequest()
.filter("id eq 'b1c5353a-7aca-41b3-830f-27d5218fe0e5'")
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.TeamsAppsRequestBuilderGetQueryParameters{
Filter: "id%20eq%20'b1c5353a-7aca-41b3-830f-27d5218fe0e5'",
}
options := &msgraphsdk.TeamsAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.AppCatalogs().TeamsApps().GetWithRequestConfigurationAndResponseHandler(options, nil)
Import-Module Microsoft.Graph.Teams
Get-MgAppCatalogTeamApp -Filter "id eq 'b1c5353a-7aca-41b3-830f-27d5218fe0e5'"
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"id": "b1c5353a-7aca-41b3-830f-27d5218fe0e5",
"externalId": "f31b1263-ba99-435a-a679-911d24850d7c",
"name": "Test App",
"version": "1.0.1",
"distributionMethod": "Organization"
}
]
}
示例 3:基于Teams应用清单 ID 查找应用程序
以下示例列出了与Teams应用清单中指定的“id”匹配的应用程序。 在此示例中,Teams 应用的清单 ID 为“cf1ba4c7-f94e-4d80-ba90-5594b641a8ee”。
请求
GET https://graph.microsoft.com/beta/appCatalogs/teamsApps?$filter=externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var teamsApps = await graphClient.AppCatalogs.TeamsApps
.Request()
.Filter("externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let teamsApps = await client.api('/appCatalogs/teamsApps')
.version('beta')
.filter('externalId eq \'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee\'')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/appCatalogs/teamsApps?$filter=externalId%20eq%20'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphTeamsApp *teamsApp = [[MSGraphTeamsApp alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
TeamsAppCollectionPage teamsApps = graphClient.appCatalogs().teamsApps()
.buildRequest()
.filter("externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'")
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.TeamsAppsRequestBuilderGetQueryParameters{
Filter: "externalId%20eq%20'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'",
}
options := &msgraphsdk.TeamsAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.AppCatalogs().TeamsApps().GetWithRequestConfigurationAndResponseHandler(options, nil)
Import-Module Microsoft.Graph.Teams
Get-MgAppCatalogTeamApp -Filter "externalId eq 'cf1ba4c7-f94e-4d80-ba90-5594b641a8ee'"
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#appCatalogs/teamsApps",
"value": [
{
"id": "22f73bbe-f67a-4dea-bd54-54cac718cb2b",
"externalId": "cf1ba4c7-f94e-4d80-ba90-5594b641a8ee",
"displayName": "YPA",
"distributionMethod": "organization"
}
]
}
示例 4:列出具有给定 ID 的应用程序,并返回提交评审状态
以下示例列出了具有给定 ID 的应用程序,并展开 appDefinitions 以返回 publishingState ,这反映了应用的提交评审状态。 Submitted 表示评审处于挂起状态, published 表示应用已由管理员批准,意味着 rejected 该应用被管理员拒绝。
请求
GET https://graph.microsoft.com/beta/appCatalogs/teamsApps?$filter=id eq '876df28f-2e78-423b-94a5-44181bd0e225'&$expand=appDefinitions
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var teamsApps = await graphClient.AppCatalogs.TeamsApps
.Request()
.Filter("id eq '876df28f-2e78-423b-94a5-44181bd0e225'")
.Expand("appDefinitions")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let teamsApps = await client.api('/appCatalogs/teamsApps')
.version('beta')
.filter('id eq \'876df28f-2e78-423b-94a5-44181bd0e225\'')
.expand('appDefinitions')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/appCatalogs/teamsApps?$filter=id%20eq%20'876df28f-2e78-423b-94a5-44181bd0e225'&$expand=appDefinitions"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphTeamsApp *teamsApp = [[MSGraphTeamsApp alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
TeamsAppCollectionPage teamsApps = graphClient.appCatalogs().teamsApps()
.buildRequest()
.filter("id eq '876df28f-2e78-423b-94a5-44181bd0e225'")
.expand("appDefinitions")
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.TeamsAppsRequestBuilderGetQueryParameters{
Filter: "id%20eq%20'876df28f-2e78-423b-94a5-44181bd0e225'",
Expand: "appDefinitions",
}
options := &msgraphsdk.TeamsAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.AppCatalogs().TeamsApps().GetWithRequestConfigurationAndResponseHandler(options, nil)
Import-Module Microsoft.Graph.Teams
Get-MgAppCatalogTeamApp -Filter "id eq '876df28f-2e78-423b-94a5-44181bd0e225'" -ExpandProperty "appDefinitions"
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"id": "876df28f-2e78-423b-94a5-44181bd0e225",
"externalId": "f31b1263-ba99-435a-a679-911d24850d7c",
"name": "Test App",
"version": "1.0.1",
"distributionMethod": "Organization",
"appDefinitions": [
{
"id": "NGQyMGNiNDUtZWViYS00ZTEyLWE3YzktMGQ0NDgzYjYxNzU2IyMxLjAuMA==",
"teamsAppId": "876df28f-2e78-423b-94a5-44181bd0e225",
"azureADAppId": null,
"displayName": "Test App",
"version": "1.0.1",
"requiredResourceSpecificApplicationPermissions": [],
"publishingState": "published"
}
]
}
]
}
示例 5:列出目录中仅包含机器人的应用的详细信息
以下示例仅列出目录中包含机器人的应用。
请求
GET https://graph.microsoft.com/beta/appCatalogs/teamsApps?$expand=appDefinitions($expand=bot)&$filter=appDefinitions/any(a:a/bot ne null)
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var teamsApps = await graphClient.AppCatalogs.TeamsApps
.Request()
.Filter("appDefinitions/any(a:a/bot ne null)")
.Expand("appDefinitions($expand=bot)")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let teamsApps = await client.api('/appCatalogs/teamsApps')
.version('beta')
.filter('appDefinitions/any(a:a/bot ne null)')
.expand('appDefinitions($expand=bot)')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/appCatalogs/teamsApps?$expand=appDefinitions($expand=bot)&$filter=appDefinitions/any(a:a/bot%20ne%20null)"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphTeamsApp *teamsApp = [[MSGraphTeamsApp alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
TeamsAppCollectionPage teamsApps = graphClient.appCatalogs().teamsApps()
.buildRequest()
.filter("appDefinitions/any(a:a/bot ne null)")
.expand("appDefinitions($expand=bot)")
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.TeamsAppsRequestBuilderGetQueryParameters{
Expand: "appDefinitions($expand=bot)",
Filter: "appDefinitions/any(a:a/bot%20ne%20null)",
}
options := &msgraphsdk.TeamsAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.AppCatalogs().TeamsApps().GetWithRequestConfigurationAndResponseHandler(options, nil)
Import-Module Microsoft.Graph.Teams
Get-MgAppCatalogTeamApp -ExpandProperty "appDefinitions(`$expand=bot)" -Filter "appDefinitions/any(a:a/bot ne null)"
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#appCatalogs/teamsApps(appDefinitions(bot()))",
"value": [
{
"id": "8a1ed7a3-5c78-46b2-8504-f9da00a1d1a6",
"externalId": "3CAB7543-216D-47C6-986C-6247670F4663",
"displayName": "Ducks-3",
"distributionMethod": "organization",
"appDefinitions": [
{
"@odata.etag": "ImNOTW1CR2V1VzgwczlEblVidU00UHc9PSI=",
"id": "OGExZWQ3YTMtNWM3OC00NmIyLTg1MDQtZjlkYTAwYTFkMWE2IyMxLjAuOSMjUmVqZWN0ZWQ=",
"teamsAppId": "8a1ed7a3-5c78-46b2-8504-f9da00a1d1a6",
"azureADAppId": null,
"displayName": "Ducks-3",
"version": "1.0.9",
"requiredResourceSpecificApplicationPermissions": [],
"publishingState": "rejected",
"shortdescription": "quaerat quasi magnam. slight change. 5",
"description": "Aliquid placeat animi debitis accusamus. Non perferendis ullam. Quis est consequuntur vitae provident. Sunt laudantium id aut. slight change 5",
"lastModifiedDateTime": "2020-11-23T21:36:00.9437445Z",
"createdBy": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "70292a90-d2a7-432c-857e-55db6d8f5cd0",
"displayName": null,
"userIdentityType": "aadUser"
}
},
"bot": {
"id": "bb9f67a4-893b-48d7-ab17-40ed466c0f16"
}
}
]
},
{
"id": "30909dee-f7dd-4f89-8b3b-55de2e32489c",
"externalId": "0ebd3f4d-ca91-495b-a227-a17d298e22cc",
"displayName": "Self-Install-App-E2E-Tests",
"distributionMethod": "organization",
"appDefinitions": [
{
"@odata.etag": "IkwzVDlMOTBSSEdTMFducHUyYkpjVmc9PSI=",
"id": "MzA5MDlkZWUtZjdkZC00Zjg5LThiM2ItNTVkZTJlMzI0ODljIyM2LjAuMCMjU3VibWl0dGVk",
"teamsAppId": "30909dee-f7dd-4f89-8b3b-55de2e32489c",
"azureADAppId": "d75abc57-8255-4309-9c29-a3c689e20341",
"displayName": "Self-Install-App-E2E-Tests",
"version": "6.0.0",
"requiredResourceSpecificApplicationPermissions": [],
"publishingState": "submitted",
"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": "2020-08-25T18:40:13.035341Z",
"createdBy": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "c071a180-a220-43a1-adaf-e8db95c4a7d6",
"displayName": null,
"userIdentityType": "aadUser"
}
},
"bot": {
"id": "da7d471b-de7d-4152-8556-1cdf7a564f6c"
}
}
]
}
]
}
示例 6:列出按应用安装范围筛选的应用的详细信息
以下示例仅列出可在用户的个人范围内安装的应用。
请求
GET https://graph.microsoft.com/beta/appCatalogs/teamsApps?$expand=appDefinitions($select=id,displayName,allowedInstallationScopes)&$filter=appDefinitions/any(a:a/allowedInstallationScopes has 'personal')
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var teamsApps = await graphClient.AppCatalogs.TeamsApps
.Request()
.Filter("appDefinitions/any(a:a/allowedInstallationScopes has 'personal')")
.Expand("appDefinitions($select=id,displayName,allowedInstallationScopes)")
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let teamsApps = await client.api('/appCatalogs/teamsApps')
.version('beta')
.filter('appDefinitions/any(a:a/allowedInstallationScopes has \'personal\')')
.expand('appDefinitions($select=id,displayName,allowedInstallationScopes)')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/appCatalogs/teamsApps?$expand=appDefinitions($select=id,displayName,allowedInstallationScopes)&$filter=appDefinitions/any(a:a/allowedInstallationScopes%20has%20'personal')"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphTeamsApp *teamsApp = [[MSGraphTeamsApp alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
TeamsAppCollectionPage teamsApps = graphClient.appCatalogs().teamsApps()
.buildRequest()
.filter("appDefinitions/any(a:a/allowedInstallationScopes has 'personal')")
.expand("appDefinitions($select=id,displayName,allowedInstallationScopes)")
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.TeamsAppsRequestBuilderGetQueryParameters{
Expand: "appDefinitions($select=id,displayName,allowedInstallationScopes)",
Filter: "appDefinitions/any(a:a/allowedInstallationScopes%20has%20'personal')",
}
options := &msgraphsdk.TeamsAppsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.AppCatalogs().TeamsApps().GetWithRequestConfigurationAndResponseHandler(options, nil)
Import-Module Microsoft.Graph.Teams
Get-MgAppCatalogTeamApp -ExpandProperty "appDefinitions(`$select=id,displayName,allowedInstallationScopes)" -Filter "appDefinitions/any(a:a/allowedInstallationScopes has 'personal')"
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#appCatalogs/teamsApps(appDefinitions(id,displayName,allowedInstallationScopes))",
"value": [
{
"id": "5a542e1c-5f8c-4793-8b0c-6082464b2378",
"externalId": "4b3ec336-b998-4623-9e25-d4182fb82159",
"displayName": "Carriage",
"distributionMethod": "organization",
"appDefinitions": [
{
"id": "MWE1NDJlMWMtNWY4Yy00NzkzLThiMGMtNjA4MjQ2NGIyMzc4IyMxLjAuMCMjUHVibGlzaGVk",
"displayName": "Carriage",
"allowedInstallationScopes": "personal"
}
]
}
]
}
另请参阅