Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Aktualisieren sie die Eigenschaften eines teamsAppSettings-Objekts .
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
TeamworkAppSettings.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
Nicht unterstützt |
Nicht unterstützt |
HTTP-Anforderung
PATCH /teamwork/teamsAppSettings
Anforderungstext
Geben Sie im Anforderungstext nur die Werte für zu aktualisierende Eigenschaften an. Vorhandene Eigenschaften, die nicht im Anforderungstext enthalten sind, behalten ihre vorherigen Werte bei oder werden basierend auf Änderungen an anderen Eigenschaftswerten neu berechnet.
In der folgenden Tabelle sind die Eigenschaften angegeben, die aktualisiert werden können.
| Eigenschaft |
Typ |
Beschreibung |
| allowUserRequestsForAppAccess |
Boolean |
Gibt an, ob Benutzer Zugriff auf die nicht verfügbaren Teams-Apps anfordern dürfen. |
| customAppSettings |
customAppSettings |
Die Einstellungen für alle benutzerdefinierten Apps im Mandanten. |
| isChatResourceSpecificConsentEnabled |
Boolean |
Gibt an, ob die ressourcenspezifische Zustimmung für Chats/Besprechungen für den Mandanten aktiviert wurde.
True gibt an, dass Teams-Apps, die im Mandanten zulässig sind und ressourcenspezifische Berechtigungen erfordern, innerhalb von Chats und Besprechungen installiert werden können.
False blockiert die Installation von Teams-Apps, die ressourcenspezifische Berechtigungen in einem Chat oder einer Besprechung erfordern. |
| isUserPersonalScopeResourceSpecificConsentEnabled |
Boolean |
Gibt an, ob die ressourcenspezifische Zustimmung für den persönlichen Bereich in Teams-Apps für den Mandanten aktiviert wurde.
True gibt an, dass Teams-Apps, die im Mandanten zulässig sind und ressourcenspezifische Berechtigungen erfordern, im persönlichen Bereich installiert werden können.
False blockiert die Installation aller Teams-Apps, die ressourcenspezifische Berechtigungen im persönlichen Bereich erfordern. |
Antwort
Wenn die Methode erfolgreich verläuft, wird der Antwortcode 204 No Content zurückgegeben.
Beispiele
Beispiel 1: Aktivieren der Installation von Apps, die ressourcenspezifische Zustimmung in Chats und Besprechungen erfordern
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/teamwork/teamsAppSettings
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.teamsAppSettings",
"isChatResourceSpecificConsentEnabled": "true"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new TeamsAppSettings
{
OdataType = "#microsoft.graph.teamsAppSettings",
IsChatResourceSpecificConsentEnabled = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.TeamsAppSettings.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeamsAppSettings()
isChatResourceSpecificConsentEnabled := true
requestBody.SetIsChatResourceSpecificConsentEnabled(&isChatResourceSpecificConsentEnabled)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teamsAppSettings, err := graphClient.Teamwork().TeamsAppSettings().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppSettings teamsAppSettings = new TeamsAppSettings();
teamsAppSettings.setOdataType("#microsoft.graph.teamsAppSettings");
teamsAppSettings.setIsChatResourceSpecificConsentEnabled(true);
TeamsAppSettings result = graphClient.teamwork().teamsAppSettings().patch(teamsAppSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const teamsAppSettings = {
'@odata.type': '#microsoft.graph.teamsAppSettings',
isChatResourceSpecificConsentEnabled: 'true'
};
await client.api('/teamwork/teamsAppSettings')
.version('beta')
.update(teamsAppSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\TeamsAppSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TeamsAppSettings();
$requestBody->setOdataType('#microsoft.graph.teamsAppSettings');
$requestBody->setIsChatResourceSpecificConsentEnabled(true);
$result = $graphServiceClient->teamwork()->teamsAppSettings()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"@odata.type" = "#microsoft.graph.teamsAppSettings"
isChatResourceSpecificConsentEnabled = "true"
}
Update-MgBetaTeamworkTeamAppSetting -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.teams_app_settings import TeamsAppSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TeamsAppSettings(
odata_type = "#microsoft.graph.teamsAppSettings",
is_chat_resource_specific_consent_enabled = True,
)
result = await graph_client.teamwork.teams_app_settings.patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 204 No Content
Beispiel 2: Zulassen, dass Teams-Benutzer Administratoren für den Zugriff auf bestimmte Teams-Apps anfordern können
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/teamwork/teamsAppSettings
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.teamsAppSettings",
"allowUserRequestsForAppAccess": "true"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new TeamsAppSettings
{
OdataType = "#microsoft.graph.teamsAppSettings",
AllowUserRequestsForAppAccess = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.TeamsAppSettings.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeamsAppSettings()
allowUserRequestsForAppAccess := true
requestBody.SetAllowUserRequestsForAppAccess(&allowUserRequestsForAppAccess)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teamsAppSettings, err := graphClient.Teamwork().TeamsAppSettings().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppSettings teamsAppSettings = new TeamsAppSettings();
teamsAppSettings.setOdataType("#microsoft.graph.teamsAppSettings");
teamsAppSettings.setAllowUserRequestsForAppAccess(true);
TeamsAppSettings result = graphClient.teamwork().teamsAppSettings().patch(teamsAppSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const teamsAppSettings = {
'@odata.type': '#microsoft.graph.teamsAppSettings',
allowUserRequestsForAppAccess: 'true'
};
await client.api('/teamwork/teamsAppSettings')
.version('beta')
.update(teamsAppSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\TeamsAppSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TeamsAppSettings();
$requestBody->setOdataType('#microsoft.graph.teamsAppSettings');
$requestBody->setAllowUserRequestsForAppAccess(true);
$result = $graphServiceClient->teamwork()->teamsAppSettings()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"@odata.type" = "#microsoft.graph.teamsAppSettings"
allowUserRequestsForAppAccess = "true"
}
Update-MgBetaTeamworkTeamAppSetting -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.teams_app_settings import TeamsAppSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TeamsAppSettings(
odata_type = "#microsoft.graph.teamsAppSettings",
allow_user_requests_for_app_access = True,
)
result = await graph_client.teamwork.teams_app_settings.patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 204 No Content
Beispiel 3: Aktivieren der Installation von Apps, die eine ressourcenspezifische Zustimmung im persönlichen Bereich von Benutzern erfordern
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/teamwork/teamsAppSettings
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.teamsAppSettings",
"isUserPersonalScopeResourceSpecificConsentEnabled": "true"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new TeamsAppSettings
{
OdataType = "#microsoft.graph.teamsAppSettings",
IsUserPersonalScopeResourceSpecificConsentEnabled = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.TeamsAppSettings.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeamsAppSettings()
isUserPersonalScopeResourceSpecificConsentEnabled := true
requestBody.SetIsUserPersonalScopeResourceSpecificConsentEnabled(&isUserPersonalScopeResourceSpecificConsentEnabled)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teamsAppSettings, err := graphClient.Teamwork().TeamsAppSettings().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppSettings teamsAppSettings = new TeamsAppSettings();
teamsAppSettings.setOdataType("#microsoft.graph.teamsAppSettings");
teamsAppSettings.setIsUserPersonalScopeResourceSpecificConsentEnabled(true);
TeamsAppSettings result = graphClient.teamwork().teamsAppSettings().patch(teamsAppSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const teamsAppSettings = {
'@odata.type': '#microsoft.graph.teamsAppSettings',
isUserPersonalScopeResourceSpecificConsentEnabled: 'true'
};
await client.api('/teamwork/teamsAppSettings')
.version('beta')
.update(teamsAppSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\TeamsAppSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TeamsAppSettings();
$requestBody->setOdataType('#microsoft.graph.teamsAppSettings');
$requestBody->setIsUserPersonalScopeResourceSpecificConsentEnabled(true);
$result = $graphServiceClient->teamwork()->teamsAppSettings()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"@odata.type" = "#microsoft.graph.teamsAppSettings"
isUserPersonalScopeResourceSpecificConsentEnabled = "true"
}
Update-MgBetaTeamworkTeamAppSetting -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.teams_app_settings import TeamsAppSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TeamsAppSettings(
odata_type = "#microsoft.graph.teamsAppSettings",
is_user_personal_scope_resource_specific_consent_enabled = True,
)
result = await graph_client.teamwork.teams_app_settings.patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 204 No Content
Beispiel 4: Aktivieren des Entwicklerportals zum Anzeigen von App-Nutzungsmetriken
Das folgende Beispiel zeigt, wie Sie der Liste der Entwicklertools hinzufügen developerPortal , die App-Nutzungsmetriken anzeigen dürfen.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/teamwork/teamsAppSettings
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.teamsAppSettings",
"customAppSettings": {
"developerToolsForShowingAppUsageMetrics": "developerPortal"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new TeamsAppSettings
{
OdataType = "#microsoft.graph.teamsAppSettings",
CustomAppSettings = new CustomAppSettings
{
DeveloperToolsForShowingAppUsageMetrics = AppDevelopmentPlatforms.DeveloperPortal,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.TeamsAppSettings.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeamsAppSettings()
customAppSettings := graphmodels.NewCustomAppSettings()
developerToolsForShowingAppUsageMetrics := graphmodels.DEVELOPERPORTAL_APPDEVELOPMENTPLATFORMS
customAppSettings.SetDeveloperToolsForShowingAppUsageMetrics(&developerToolsForShowingAppUsageMetrics)
requestBody.SetCustomAppSettings(customAppSettings)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teamsAppSettings, err := graphClient.Teamwork().TeamsAppSettings().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TeamsAppSettings teamsAppSettings = new TeamsAppSettings();
teamsAppSettings.setOdataType("#microsoft.graph.teamsAppSettings");
CustomAppSettings customAppSettings = new CustomAppSettings();
customAppSettings.setDeveloperToolsForShowingAppUsageMetrics(EnumSet.of(AppDevelopmentPlatforms.DeveloperPortal));
teamsAppSettings.setCustomAppSettings(customAppSettings);
TeamsAppSettings result = graphClient.teamwork().teamsAppSettings().patch(teamsAppSettings);
const options = {
authProvider,
};
const client = Client.init(options);
const teamsAppSettings = {
'@odata.type': '#microsoft.graph.teamsAppSettings',
customAppSettings: {
developerToolsForShowingAppUsageMetrics: 'developerPortal'
}
};
await client.api('/teamwork/teamsAppSettings')
.version('beta')
.update(teamsAppSettings);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\TeamsAppSettings;
use Microsoft\Graph\Beta\Generated\Models\CustomAppSettings;
use Microsoft\Graph\Beta\Generated\Models\AppDevelopmentPlatforms;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TeamsAppSettings();
$requestBody->setOdataType('#microsoft.graph.teamsAppSettings');
$customAppSettings = new CustomAppSettings();
$customAppSettings->setDeveloperToolsForShowingAppUsageMetrics(new AppDevelopmentPlatforms('developerPortal'));
$requestBody->setCustomAppSettings($customAppSettings);
$result = $graphServiceClient->teamwork()->teamsAppSettings()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"@odata.type" = "#microsoft.graph.teamsAppSettings"
customAppSettings = @{
developerToolsForShowingAppUsageMetrics = "developerPortal"
}
}
Update-MgBetaTeamworkTeamAppSetting -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.teams_app_settings import TeamsAppSettings
from msgraph_beta.generated.models.custom_app_settings import CustomAppSettings
from msgraph_beta.generated.models.app_development_platforms import AppDevelopmentPlatforms
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TeamsAppSettings(
odata_type = "#microsoft.graph.teamsAppSettings",
custom_app_settings = CustomAppSettings(
developer_tools_for_showing_app_usage_metrics = AppDevelopmentPlatforms.DeveloperPortal,
),
)
result = await graph_client.teamwork.teams_app_settings.patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 204 No Content
Verwandte Inhalte
Ressourcenspezifische Zustimmung