Indiquez à l’application consommatrice les actions qu’elle doit effectuer pour supprimer les informations d’étiquette.
L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
Pour évaluer la suppression en tant qu’utilisateur connecté (autorisation déléguée) ou utilisateur spécifié (autorisation d’application) :
Pour évaluer la suppression en tant que principal de service (autorisation d’application) :
Dans le corps de la demande, fournissez une représentation JSON des paramètres.
Le tableau suivant indique les paramètres utilisables avec cette action.
Voici un exemple de requête.
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
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.Users.Item.Security.InformationProtection.SensitivityLabels.MicrosoftGraphSecurityEvaluateRemoval.EvaluateRemovalPostRequestBody
{
ContentInfo = new Microsoft.Graph.Beta.Models.Security.ContentInfo
{
OdataType = "#microsoft.graph.security.contentInfo",
Identifier = null,
State = Microsoft.Graph.Beta.Models.Security.ContentState.Rest,
Metadata = new List<Microsoft.Graph.Beta.Models.Security.KeyValuePair>
{
new Microsoft.Graph.Beta.Models.Security.KeyValuePair
{
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled",
Value = "True",
},
new Microsoft.Graph.Beta.Models.Security.KeyValuePair
{
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method",
Value = "Standard",
},
new Microsoft.Graph.Beta.Models.Security.KeyValuePair
{
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate",
Value = "1/1/0001 12:00:00 AM",
},
new Microsoft.Graph.Beta.Models.Security.KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId",
Value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c",
},
new Microsoft.Graph.Beta.Models.Security.KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name",
Value = "LabelScopedToBob_Tests",
},
new Microsoft.Graph.Beta.Models.Security.KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits",
Value = "0",
},
new Microsoft.Graph.Beta.Models.Security.KeyValuePair
{
OdataType = "#microsoft.graph.security.keyValuePair",
Name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId",
Value = "00000000-0000-0000-0000-000000000000",
},
},
},
DowngradeJustification = new Microsoft.Graph.Beta.Models.Security.DowngradeJustification
{
JustificationMessage = "The information has been declassified.",
IsDowngradeJustified = true,
},
};
var result = await graphClient.Users["{user-id}"].Security.InformationProtection.SensitivityLabels.MicrosoftGraphSecurityEvaluateRemoval.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("User-Agent", "ContosoLOBApp/1.0");
});
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
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\
}\
}\
'
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
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
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)
microsoftGraphSecurityEvaluateRemoval, err := graphClient.Users().ByUserId("user-id").Security().InformationProtection().SensitivityLabels().MicrosoftGraphSecurityEvaluateRemoval().Post(context.Background(), requestBody, configuration)
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("User-Agent", "ContosoLOBApp/1.0"));
ContentInfo contentInfo = new ContentInfo();
contentInfo.identifier = null;
contentInfo.state = ContentState.REST;
LinkedList<KeyValuePair> metadataList = new LinkedList<KeyValuePair>();
KeyValuePair metadata = new KeyValuePair();
metadata.name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled";
metadata.value = "True";
metadataList.add(metadata);
KeyValuePair metadata1 = new KeyValuePair();
metadata1.name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method";
metadata1.value = "Standard";
metadataList.add(metadata1);
KeyValuePair metadata2 = new KeyValuePair();
metadata2.name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate";
metadata2.value = "1/1/0001 12:00:00 AM";
metadataList.add(metadata2);
KeyValuePair metadata3 = new KeyValuePair();
metadata3.name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId";
metadata3.value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c";
metadataList.add(metadata3);
KeyValuePair metadata4 = new KeyValuePair();
metadata4.name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name";
metadata4.value = "LabelScopedToBob_Tests";
metadataList.add(metadata4);
KeyValuePair metadata5 = new KeyValuePair();
metadata5.name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits";
metadata5.value = "0";
metadataList.add(metadata5);
KeyValuePair metadata6 = new KeyValuePair();
metadata6.name = "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId";
metadata6.value = "00000000-0000-0000-0000-000000000000";
metadataList.add(metadata6);
contentInfo.metadata = metadataList;
DowngradeJustification downgradeJustification = new DowngradeJustification();
downgradeJustification.justificationMessage = "The information has been declassified.";
downgradeJustification.isDowngradeJustified = true;
graphClient.users("bob@contoso.com").security().informationProtection().sensitivityLabels()
.evaluateRemoval(SensitivityLabelEvaluateRemovalParameterSet
.newBuilder()
.withContentInfo(contentInfo)
.withDowngradeJustification(downgradeJustification)
.build())
.buildRequest( requestOptions )
.post();
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
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$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
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
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 = EvaluateRemovalRequestBuilder.EvaluateRemovalRequestBuilderPostRequestConfiguration(
headers = {
'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(body = request_body, request_configuration = request_configuration)
Voici un exemple de réponse.