As APIs na versão /beta no Microsoft Graph estão sujeitas a alterações. Não há suporte para o uso dessas APIs em aplicativos de produção. Para determinar se uma API está disponível na v1.0, use o seletor de versão.
Uma das seguintes permissões é obrigatória para chamar esta API. Para saber mais, incluindo como escolher permissões, confira Permissões.
Tipo de permissão
Permissões (da com menos para a com mais privilégios)
Delegado (conta corporativa ou de estudante)
InformationProtectionPolicy. Read
Delegado (conta pessoal da Microsoft)
Sem suporte.
Aplicativo
InformationProtectionPolicy.Read.All
Solicitação HTTP
POST /informationprotection/policy/labels/extractLabel
Cabeçalhos de solicitação
Nome
Descrição
Autorização
{token} de portador. Obrigatório.
Content-type
Tipo de conteúdo: application/json. Obrigatório.
User-Agent
Descreve o nome e a versão do aplicativo de chamada. Os detalhes aparecerão no Azure Information Protection Analytics. O formato sugerido é ApplicationName/Version. Opcional.
Corpo da solicitação
Forneça um objeto JSON com os seguintes parâmetros no corpo da solicitação.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var contentInfo = new ContentInfo
{
Format = ContentFormat.Default,
Identifier = null,
State = ContentState.Rest,
Metadata = new List<KeyValuePair>()
{
new KeyValuePair
{
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled",
Value = "True"
},
new KeyValuePair
{
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method",
Value = "Standard"
},
new KeyValuePair
{
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate",
Value = "1/1/0001 12:00:00 AM"
},
new KeyValuePair
{
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId",
Value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
},
new KeyValuePair
{
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name",
Value = "Top Secret"
},
new KeyValuePair
{
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits",
Value = "0"
},
new KeyValuePair
{
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId",
Value = "00000000-0000-0000-0000-000000000000"
}
},
AdditionalData = new Dictionary<string, object>()
{
{"format@odata.type", "#microsoft.graph.contentFormat"},
{"state@odata.type", "#microsoft.graph.contentState"},
{"metadata@odata.type", "#Collection(microsoft.graph.keyValuePair)"}
}
};
await graphClient.InformationProtection.Policy.Labels
.ExtractLabel(contentInfo)
.Request()
.Header("User-Agent","ContosoLOBApp/1.0")
.PostAsync();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewContentInfoRequestBody()
contentInfo := msgraphsdk.NewContentInfo()
requestBody.SetContentInfo(contentInfo)
format := "default"
contentInfo.SetFormat(&format)
contentInfo.SetIdentifier(nil)
state := "rest"
contentInfo.SetState(&state)
contentInfo.SetMetadata( []KeyValuePair {
msgraphsdk.NewKeyValuePair(),
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled"
SetName(&name)
value := "True"
SetValue(&value)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.keyValuePair",
}
msgraphsdk.NewKeyValuePair(),
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method"
SetName(&name)
value := "Standard"
SetValue(&value)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.keyValuePair",
}
msgraphsdk.NewKeyValuePair(),
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate"
SetName(&name)
value := "1/1/0001 12:00:00 AM"
SetValue(&value)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.keyValuePair",
}
msgraphsdk.NewKeyValuePair(),
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId"
SetName(&name)
value := "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
SetValue(&value)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.keyValuePair",
}
msgraphsdk.NewKeyValuePair(),
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name"
SetName(&name)
value := "Top Secret"
SetValue(&value)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.keyValuePair",
}
msgraphsdk.NewKeyValuePair(),
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits"
SetName(&name)
value := "0"
SetValue(&value)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.keyValuePair",
}
msgraphsdk.NewKeyValuePair(),
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId"
SetName(&name)
value := "00000000-0000-0000-0000-000000000000"
SetValue(&value)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.keyValuePair",
}
}
contentInfo.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.contentInfo",
"format@odata.type": "#microsoft.graph.contentFormat",
"state@odata.type": "#microsoft.graph.contentState",
"metadata@odata.type": "#Collection(microsoft.graph.keyValuePair)",
}
headers := map[string]string{
"User-Agent": "ContosoLOBApp/1.0"
}
options := &msgraphsdk.ExtractLabelRequestBuilderPostRequestConfiguration{
Headers: headers,
}
result, err := graphClient.InformationProtection().Policy().Labels().ExtractLabel().PostWithRequestConfigurationAndResponseHandler(requestBody, options, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
ContentInfo = @{
"@odata.type" = "#microsoft.graph.contentInfo"
"Format@odata.type" = "#microsoft.graph.contentFormat"
Format = "default"
Identifier = $null
"State@odata.type" = "#microsoft.graph.contentState"
State = "rest"
"Metadata@odata.type" = "#Collection(microsoft.graph.keyValuePair)"
Metadata = @(
@{
"@odata.type" = "#microsoft.graph.keyValuePair"
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled"
Value = "True"
}
@{
"@odata.type" = "#microsoft.graph.keyValuePair"
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method"
Value = "Standard"
}
@{
"@odata.type" = "#microsoft.graph.keyValuePair"
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate"
Value = "1/1/0001 12:00:00 AM"
}
@{
"@odata.type" = "#microsoft.graph.keyValuePair"
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId"
Value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
}
@{
"@odata.type" = "#microsoft.graph.keyValuePair"
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name"
Value = "Top Secret"
}
@{
"@odata.type" = "#microsoft.graph.keyValuePair"
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits"
Value = "0"
}
@{
"@odata.type" = "#microsoft.graph.keyValuePair"
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId"
Value = "00000000-0000-0000-0000-000000000000"
}
)
}
}
Invoke-MgExtractInformationProtectionPolicyLabel -BodyParameter $params
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.