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.
Tipo de permissão
Permissões com menos privilégios
Permissões com privilégios superiores
Delegado (conta corporativa ou de estudante)
RecordsManagement.ReadWrite.All
Indisponível.
Delegado (conta pessoal da Microsoft)
Sem suporte.
Sem suporte.
Application
RecordsManagement.ReadWrite.All
Indisponível.
Solicitação HTTP
POST /security/labels/categories/{categoryTemplateId}/subcategories
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.Security;
var requestBody = new SubcategoryTemplate
{
OdataType = "#microsoft.graph.security.subcategoryTemplate",
DisplayName = "Vendor Invoice",
};
// 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.Categories["{categoryTemplate-id}"].Subcategories.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.NewSubcategoryTemplate()
displayName := "Vendor Invoice"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
subcategories, err := graphClient.Security().Labels().Categories().ByCategoryTemplateId("categoryTemplate-id").Subcategories().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.SubcategoryTemplate subcategoryTemplate = new com.microsoft.graph.models.security.SubcategoryTemplate();
subcategoryTemplate.setOdataType("#microsoft.graph.security.subcategoryTemplate");
subcategoryTemplate.setDisplayName("Vendor Invoice");
com.microsoft.graph.models.security.SubcategoryTemplate result = graphClient.security().labels().categories().byCategoryTemplateId("{categoryTemplate-id}").subcategories().post(subcategoryTemplate);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Security\SubcategoryTemplate;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SubcategoryTemplate();
$requestBody->setOdataType('#microsoft.graph.security.subcategoryTemplate');
$requestBody->setDisplayName('Vendor Invoice');
$result = $graphServiceClient->security()->labels()->categories()->byCategoryTemplateId('categoryTemplate-id')->subcategories()->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.subcategory_template import SubcategoryTemplate
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SubcategoryTemplate(
odata_type = "#microsoft.graph.security.subcategoryTemplate",
display_name = "Vendor Invoice",
)
result = await graph_client.security.labels.categories.by_category_template_id('categoryTemplate-id').subcategories.post(request_body)