Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
POST https://graph.microsoft.com/beta/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.Beta.Models.Security;
var requestBody = new AuthorityTemplate
{
OdataType = "#microsoft.graph.security.authorityTemplate",
DisplayName = "Business",
};
// To initialize your graphClient, see https://learn.microsoft.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 $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelssecurity "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security"
//other-imports
)
requestBody := graphmodelssecurity.NewAuthorityTemplate()
displayName := "Business"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.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.beta.models.security.AuthorityTemplate authorityTemplate = new com.microsoft.graph.beta.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\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\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_beta import GraphServiceClient
from msgraph_beta.generated.models.security.authority_template import AuthorityTemplate
# To initialize your graph_client, see https://learn.microsoft.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)