Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
POST https://graph.microsoft.com/v1.0/security/labels/authorities
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.security.authorityTemplate",
"displayName": "Business",
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.Security;
var requestBody = new AuthorityTemplate
{
OdataType = "#microsoft.graph.security.authorityTemplate",
DisplayName = "Business",
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.Labels.Authorities.PostAsync(requestBody);
// 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"
graphmodelssecurity "github.com/microsoftgraph/msgraph-sdk-go/models/security"
//other-imports
)
requestBody := graphmodelssecurity.NewAuthorityTemplate()
displayName := "Business"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authorities, err := graphClient.Security().Labels().Authorities().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.security.AuthorityTemplate authorityTemplate = new com.microsoft.graph.models.security.AuthorityTemplate();
authorityTemplate.setOdataType("#microsoft.graph.security.authorityTemplate");
authorityTemplate.setDisplayName("Business");
com.microsoft.graph.models.security.AuthorityTemplate result = graphClient.security().labels().authorities().post(authorityTemplate);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Security\AuthorityTemplate;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AuthorityTemplate();
$requestBody->setOdataType('#microsoft.graph.security.authorityTemplate');
$requestBody->setDisplayName('Business');
$result = $graphServiceClient->security()->labels()->authorities()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.security.authority_template import AuthorityTemplate
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AuthorityTemplate(
odata_type = "#microsoft.graph.security.authorityTemplate",
display_name = "Business",
)
result = await graph_client.security.labels.authorities.post(request_body)