Indique ao aplicativo consumidor quais ações devem ser tomadas para remover as informações do rótulo.
Escolha a permissão ou as permissões marcadas como menos privilegiadas para essa API. Use uma permissão ou permissões privilegiadas mais altas somente se o aplicativo exigir. Para obter detalhes sobre permissões delegadas e de aplicativo, consulte Tipos de permissão. Para saber mais sobre essas permissões, consulte a referência de permissões.
Para avaliar a remoção como o usuário conectado (permissão delegada) ou um usuário especificado (permissão do aplicativo):
No corpo da solicitação, forneça uma representação JSON dos parâmetros.
A tabela a seguir mostra os parâmetros que podem ser usados com esta ação.
O exemplo a seguir mostra uma solicitação.
POST https://graph.microsoft.com/beta/users/bob@contoso.com/security/informationProtection/sensitivityLabels/evaluateRemoval
Content-type: application/json
User-agent: ContosoLOBApp/1.0
{
"contentInfo": {
"@odata.type": "#microsoft.graph.security.contentInfo",
"identifier": null,
"state": "rest",
"metadata": [
{
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled",
"value": "True"
},
{
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method",
"value": "Standard"
},
{
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate",
"value": "1/1/0001 12:00:00 AM"
},
{
"@odata.type": "#microsoft.graph.security.keyValuePair",
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId",
"value": "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
},
{
"@odata.type": "#microsoft.graph.security.keyValuePair",
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name",
"value": "LabelScopedToBob_Tests"
},
{
"@odata.type": "#microsoft.graph.security.keyValuePair",
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits",
"value": "0"
},
{
"@odata.type": "#microsoft.graph.security.keyValuePair",
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId",
"value": "00000000-0000-0000-0000-000000000000"
}
]
},
"downgradeJustification": {
"justificationMessage": "The information has been declassified.",
"isDowngradeJustified": true
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Users.Item.Security.InformationProtection.SensitivityLabels.MicrosoftGraphSecurityEvaluateRemoval;
using Microsoft.Graph.Beta.Models.Security;
var requestBody = new EvaluateRemovalPostRequestBody
{
ContentInfo = new ContentInfo
{
OdataType = "#microsoft.graph.security.contentInfo",
Identifier = null,
State = ContentState.Rest,
Metadata = new List<KeyValuePair>
{
new KeyValuePair
{
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled",
Value = "True",
},
new KeyValuePair
{
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method",
Value = "Standard",
},
new KeyValuePair
{
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate",
Value = "1/1/0001 12:00:00 AM",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId",
Value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name",
Value = "LabelScopedToBob_Tests",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits",
Value = "0",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId",
Value = "00000000-0000-0000-0000-000000000000",
},
},
},
DowngradeJustification = new DowngradeJustification
{
JustificationMessage = "The information has been declassified.",
IsDowngradeJustified = true,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Users["{user-id}"].Security.InformationProtection.SensitivityLabels.MicrosoftGraphSecurityEvaluateRemoval.PostAsEvaluateRemovalPostResponseAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("User-Agent", "ContosoLOBApp/1.0");
});
mgc-beta users security information-protection sensitivity-labels microsoft-graph-security-evaluate-removal post --user-id {user-id} --body '{\
"contentInfo": {\
"@odata.type": "#microsoft.graph.security.contentInfo",\
"identifier": null,\
"state": "rest",\
"metadata": [\
{\
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled",\
"value": "True"\
},\
{\
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method",\
"value": "Standard"\
},\
{\
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate",\
"value": "1/1/0001 12:00:00 AM"\
},\
{\
"@odata.type": "#microsoft.graph.security.keyValuePair",\
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId",\
"value": "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"\
},\
{\
"@odata.type": "#microsoft.graph.security.keyValuePair",\
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name",\
"value": "LabelScopedToBob_Tests"\
},\
{\
"@odata.type": "#microsoft.graph.security.keyValuePair",\
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits",\
"value": "0"\
},\
{\
"@odata.type": "#microsoft.graph.security.keyValuePair",\
"name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId",\
"value": "00000000-0000-0000-0000-000000000000"\
}\
]\
},\
"downgradeJustification": {\
"justificationMessage": "The information has been declassified.",\
"isDowngradeJustified": true\
}\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
graphmodelssecurity "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security"
//other-imports
)
headers := abstractions.NewRequestHeaders()
headers.Add("User-Agent", "ContosoLOBApp/1.0")
configuration := &graphusers.UserItemSecurityInformationProtectionSensitivityLabelsMicrosoft.graph.security.evaluateRemovalRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphusers.NewEvaluateRemovalPostRequestBody()
contentInfo := graphmodelssecurity.NewContentInfo()
identifier := null
contentInfo.SetIdentifier(&identifier)
state := graphmodels.REST_CONTENTSTATE
contentInfo.SetState(&state)
keyValuePair := graphmodelssecurity.NewKeyValuePair()
name := "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled"
keyValuePair.SetName(&name)
value := "True"
keyValuePair.SetValue(&value)
keyValuePair1 := graphmodelssecurity.NewKeyValuePair()
name := "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method"
keyValuePair1.SetName(&name)
value := "Standard"
keyValuePair1.SetValue(&value)
keyValuePair2 := graphmodelssecurity.NewKeyValuePair()
name := "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate"
keyValuePair2.SetName(&name)
value := "1/1/0001 12:00:00 AM"
keyValuePair2.SetValue(&value)
keyValuePair3 := graphmodelssecurity.NewKeyValuePair()
name := "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId"
keyValuePair3.SetName(&name)
value := "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
keyValuePair3.SetValue(&value)
keyValuePair4 := graphmodelssecurity.NewKeyValuePair()
name := "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name"
keyValuePair4.SetName(&name)
value := "LabelScopedToBob_Tests"
keyValuePair4.SetValue(&value)
keyValuePair5 := graphmodelssecurity.NewKeyValuePair()
name := "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits"
keyValuePair5.SetName(&name)
value := "0"
keyValuePair5.SetValue(&value)
keyValuePair6 := graphmodelssecurity.NewKeyValuePair()
name := "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId"
keyValuePair6.SetName(&name)
value := "00000000-0000-0000-0000-000000000000"
keyValuePair6.SetValue(&value)
metadata := []graphmodelssecurity.KeyValuePairable {
keyValuePair,
keyValuePair1,
keyValuePair2,
keyValuePair3,
keyValuePair4,
keyValuePair5,
keyValuePair6,
}
contentInfo.SetMetadata(metadata)
requestBody.SetContentInfo(contentInfo)
downgradeJustification := graphmodelssecurity.NewDowngradeJustification()
justificationMessage := "The information has been declassified."
downgradeJustification.SetJustificationMessage(&justificationMessage)
isDowngradeJustified := true
downgradeJustification.SetIsDowngradeJustified(&isDowngradeJustified)
requestBody.SetDowngradeJustification(downgradeJustification)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
microsoftGraphSecurityEvaluateRemoval, err := graphClient.Users().ByUserId("user-id").Security().InformationProtection().SensitivityLabels().MicrosoftGraphSecurityEvaluateRemoval().PostAsEvaluateRemovalPostResponse(context.Background(), requestBody, configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.users.item.security.informationprotection.sensitivitylabels.microsoftgraphsecurityevaluateremoval.EvaluateRemovalPostRequestBody evaluateRemovalPostRequestBody = new com.microsoft.graph.beta.users.item.security.informationprotection.sensitivitylabels.microsoftgraphsecurityevaluateremoval.EvaluateRemovalPostRequestBody();
com.microsoft.graph.beta.models.security.ContentInfo contentInfo = new com.microsoft.graph.beta.models.security.ContentInfo();
contentInfo.setOdataType("#microsoft.graph.security.contentInfo");
contentInfo.setIdentifier(null);
contentInfo.setState(com.microsoft.graph.beta.models.security.ContentState.Rest);
LinkedList<com.microsoft.graph.beta.models.security.KeyValuePair> metadata = new LinkedList<com.microsoft.graph.beta.models.security.KeyValuePair>();
com.microsoft.graph.beta.models.security.KeyValuePair keyValuePair = new com.microsoft.graph.beta.models.security.KeyValuePair();
keyValuePair.setName("MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled");
keyValuePair.setValue("True");
metadata.add(keyValuePair);
com.microsoft.graph.beta.models.security.KeyValuePair keyValuePair1 = new com.microsoft.graph.beta.models.security.KeyValuePair();
keyValuePair1.setName("MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method");
keyValuePair1.setValue("Standard");
metadata.add(keyValuePair1);
com.microsoft.graph.beta.models.security.KeyValuePair keyValuePair2 = new com.microsoft.graph.beta.models.security.KeyValuePair();
keyValuePair2.setName("MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate");
keyValuePair2.setValue("1/1/0001 12:00:00 AM");
metadata.add(keyValuePair2);
com.microsoft.graph.beta.models.security.KeyValuePair keyValuePair3 = new com.microsoft.graph.beta.models.security.KeyValuePair();
keyValuePair3.setOdataType("#microsoft.graph.security.keyValuePair");
keyValuePair3.setName("MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId");
keyValuePair3.setValue("cfa4cf1d-a337-4481-aa99-19d8f3d63f7c");
metadata.add(keyValuePair3);
com.microsoft.graph.beta.models.security.KeyValuePair keyValuePair4 = new com.microsoft.graph.beta.models.security.KeyValuePair();
keyValuePair4.setOdataType("#microsoft.graph.security.keyValuePair");
keyValuePair4.setName("MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name");
keyValuePair4.setValue("LabelScopedToBob_Tests");
metadata.add(keyValuePair4);
com.microsoft.graph.beta.models.security.KeyValuePair keyValuePair5 = new com.microsoft.graph.beta.models.security.KeyValuePair();
keyValuePair5.setOdataType("#microsoft.graph.security.keyValuePair");
keyValuePair5.setName("MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits");
keyValuePair5.setValue("0");
metadata.add(keyValuePair5);
com.microsoft.graph.beta.models.security.KeyValuePair keyValuePair6 = new com.microsoft.graph.beta.models.security.KeyValuePair();
keyValuePair6.setOdataType("#microsoft.graph.security.keyValuePair");
keyValuePair6.setName("MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId");
keyValuePair6.setValue("00000000-0000-0000-0000-000000000000");
metadata.add(keyValuePair6);
contentInfo.setMetadata(metadata);
evaluateRemovalPostRequestBody.setContentInfo(contentInfo);
com.microsoft.graph.beta.models.security.DowngradeJustification downgradeJustification = new com.microsoft.graph.beta.models.security.DowngradeJustification();
downgradeJustification.setJustificationMessage("The information has been declassified.");
downgradeJustification.setIsDowngradeJustified(true);
evaluateRemovalPostRequestBody.setDowngradeJustification(downgradeJustification);
var result = graphClient.users().byUserId("{user-id}").security().informationProtection().sensitivityLabels().microsoftGraphSecurityEvaluateRemoval().post(evaluateRemovalPostRequestBody, requestConfiguration -> {
requestConfiguration.headers.add("User-Agent", "ContosoLOBApp/1.0");
});
const options = {
authProvider,
};
const client = Client.init(options);
const informationProtectionAction = {
contentInfo: {
'@odata.type': '#microsoft.graph.security.contentInfo',
identifier: null,
state: 'rest',
metadata: [
{
name: 'MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled',
value: 'True'
},
{
name: 'MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method',
value: 'Standard'
},
{
name: 'MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate',
value: '1/1/0001 12:00:00 AM'
},
{
'@odata.type': '#microsoft.graph.security.keyValuePair',
name: 'MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId',
value: 'cfa4cf1d-a337-4481-aa99-19d8f3d63f7c'
},
{
'@odata.type': '#microsoft.graph.security.keyValuePair',
name: 'MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name',
value: 'LabelScopedToBob_Tests'
},
{
'@odata.type': '#microsoft.graph.security.keyValuePair',
name: 'MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits',
value: '0'
},
{
'@odata.type': '#microsoft.graph.security.keyValuePair',
name: 'MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId',
value: '00000000-0000-0000-0000-000000000000'
}
]
},
downgradeJustification: {
justificationMessage: 'The information has been declassified.',
isDowngradeJustified: true
}
};
await client.api('/users/bob@contoso.com/security/informationProtection/sensitivityLabels/evaluateRemoval')
.version('beta')
.post(informationProtectionAction);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Security\InformationProtection\SensitivityLabels\Microsoft\Graph\Security\EvaluateRemoval\EvaluateRemovalRequestBuilderPostRequestConfiguration;
use Microsoft\Graph\Beta\Generated\Users\Item\Security\InformationProtection\SensitivityLabels\MicrosoftGraphSecurityEvaluateRemoval\EvaluateRemovalPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Security\ContentInfo;
use Microsoft\Graph\Beta\Generated\Models\Security\ContentState;
use Microsoft\Graph\Beta\Generated\Models\Security\KeyValuePair;
use Microsoft\Graph\Beta\Generated\Models\Security\DowngradeJustification;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EvaluateRemovalPostRequestBody();
$contentInfo = new ContentInfo();
$contentInfo->setOdataType('#microsoft.graph.security.contentInfo');
$contentInfo->setIdentifier(null);
$contentInfo->setState(new ContentState('rest'));
$metadataKeyValuePair1 = new KeyValuePair();
$metadataKeyValuePair1->setName('MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled');
$metadataKeyValuePair1->setValue('True');
$metadataArray []= $metadataKeyValuePair1;
$metadataKeyValuePair2 = new KeyValuePair();
$metadataKeyValuePair2->setName('MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method');
$metadataKeyValuePair2->setValue('Standard');
$metadataArray []= $metadataKeyValuePair2;
$metadataKeyValuePair3 = new KeyValuePair();
$metadataKeyValuePair3->setName('MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate');
$metadataKeyValuePair3->setValue('1/1/0001 12:00:00 AM');
$metadataArray []= $metadataKeyValuePair3;
$metadataKeyValuePair4 = new KeyValuePair();
$metadataKeyValuePair4->setOdataType('#microsoft.graph.security.keyValuePair');
$metadataKeyValuePair4->setName('MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId');
$metadataKeyValuePair4->setValue('cfa4cf1d-a337-4481-aa99-19d8f3d63f7c');
$metadataArray []= $metadataKeyValuePair4;
$metadataKeyValuePair5 = new KeyValuePair();
$metadataKeyValuePair5->setOdataType('#microsoft.graph.security.keyValuePair');
$metadataKeyValuePair5->setName('MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name');
$metadataKeyValuePair5->setValue('LabelScopedToBob_Tests');
$metadataArray []= $metadataKeyValuePair5;
$metadataKeyValuePair6 = new KeyValuePair();
$metadataKeyValuePair6->setOdataType('#microsoft.graph.security.keyValuePair');
$metadataKeyValuePair6->setName('MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits');
$metadataKeyValuePair6->setValue('0');
$metadataArray []= $metadataKeyValuePair6;
$metadataKeyValuePair7 = new KeyValuePair();
$metadataKeyValuePair7->setOdataType('#microsoft.graph.security.keyValuePair');
$metadataKeyValuePair7->setName('MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId');
$metadataKeyValuePair7->setValue('00000000-0000-0000-0000-000000000000');
$metadataArray []= $metadataKeyValuePair7;
$contentInfo->setMetadata($metadataArray);
$requestBody->setContentInfo($contentInfo);
$downgradeJustification = new DowngradeJustification();
$downgradeJustification->setJustificationMessage('The information has been declassified.');
$downgradeJustification->setIsDowngradeJustified(true);
$requestBody->setDowngradeJustification($downgradeJustification);
$requestConfiguration = new MicrosoftEvaluateRemovalRequestBuilderPostRequestConfiguration();
$headers = [
'User-Agent' => 'ContosoLOBApp/1.0',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->users()->byUserId('user-id')->security()->informationProtection()->sensitivityLabels()->microsoftGraphSecurityEvaluateRemoval()->post($requestBody, $requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Users.Actions
$params = @{
contentInfo = @{
"@odata.type" = "#microsoft.graph.security.contentInfo"
identifier = $null
state = "rest"
metadata = @(
@{
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled"
value = "True"
}
@{
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method"
value = "Standard"
}
@{
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate"
value = "1/1/0001 12:00:00 AM"
}
@{
"@odata.type" = "#microsoft.graph.security.keyValuePair"
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId"
value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
}
@{
"@odata.type" = "#microsoft.graph.security.keyValuePair"
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name"
value = "LabelScopedToBob_Tests"
}
@{
"@odata.type" = "#microsoft.graph.security.keyValuePair"
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits"
value = "0"
}
@{
"@odata.type" = "#microsoft.graph.security.keyValuePair"
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId"
value = "00000000-0000-0000-0000-000000000000"
}
)
}
downgradeJustification = @{
justificationMessage = "The information has been declassified."
isDowngradeJustified = $true
}
}
Test-MgBetaUserSecurityInformationProtectionSensitivityLabelRemoval -UserId $userId -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.users.item.security.information_protection.sensitivity_labels.microsoft.graph.security.evaluate_removal.evaluate_removal_request_builder import EvaluateRemovalRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
from msgraph_beta.generated.users.item.security.informationprotection.sensitivitylabels.microsoft_graph_security_evaluate_removal.evaluate_removal_post_request_body import EvaluateRemovalPostRequestBody
from msgraph_beta.generated.models.security.content_info import ContentInfo
from msgraph_beta.generated.models.content_state import ContentState
from msgraph_beta.generated.models.security.key_value_pair import KeyValuePair
from msgraph_beta.generated.models.security.downgrade_justification import DowngradeJustification
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = EvaluateRemovalPostRequestBody(
content_info = ContentInfo(
odata_type = "#microsoft.graph.security.contentInfo",
identifier = None,
state = ContentState.Rest,
metadata = [
KeyValuePair(
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled",
value = "True",
),
KeyValuePair(
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method",
value = "Standard",
),
KeyValuePair(
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate",
value = "1/1/0001 12:00:00 AM",
),
KeyValuePair(
odata_type = "#microsoft.graph.security.keyValuePair",
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId",
value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c",
),
KeyValuePair(
odata_type = "#microsoft.graph.security.keyValuePair",
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name",
value = "LabelScopedToBob_Tests",
),
KeyValuePair(
odata_type = "#microsoft.graph.security.keyValuePair",
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits",
value = "0",
),
KeyValuePair(
odata_type = "#microsoft.graph.security.keyValuePair",
name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId",
value = "00000000-0000-0000-0000-000000000000",
),
],
),
downgrade_justification = DowngradeJustification(
justification_message = "The information has been declassified.",
is_downgrade_justified = True,
),
)
request_configuration = RequestConfiguration()
request_configuration.headers.add("User-Agent", "ContosoLOBApp/1.0")
result = await graph_client.users.by_user_id('user-id').security.information_protection.sensitivity_labels.microsoft_graph_security_evaluate_removal.post(request_body, request_configuration = request_configuration)
O exemplo a seguir mostra a resposta.