POST https://graph.microsoft.com/beta/informationProtection/policy/labels/evaluateRemoval
Content-type: application/json
User-agent: ContosoLOBApp/1.0
{
"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": "General"
},
{
"@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"
}
]
},
"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.InformationProtection.Policy.Labels.EvaluateRemoval;
using Microsoft.Graph.Beta.Models;
var requestBody = new EvaluateRemovalPostRequestBody
{
ContentInfo = new ContentInfo
{
OdataType = "#microsoft.graph.contentInfo",
Format = ContentFormat.Default,
Identifier = null,
State = ContentState.Rest,
Metadata = new List<KeyValuePair>
{
new KeyValuePair
{
OdataType = "#microsoft.graph.keyValuePair",
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled",
Value = "True",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.keyValuePair",
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method",
Value = "Standard",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.keyValuePair",
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate",
Value = "1/1/0001 12:00:00 AM",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.keyValuePair",
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId",
Value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.keyValuePair",
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name",
Value = "General",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.keyValuePair",
Name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits",
Value = "0",
},
new KeyValuePair
{
OdataType = "#microsoft.graph.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)"
},
},
},
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.InformationProtection.Policy.Labels.EvaluateRemoval.PostAsEvaluateRemovalPostResponseAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("User-Agent", "ContosoLOBApp/1.0");
});
mgc-beta information-protection policy labels evaluate-removal post --body '{\
"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": "General"\
},\
{\
"@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"\
}\
]\
},\
"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"
graphinformationprotection "github.com/microsoftgraph/msgraph-beta-sdk-go/informationprotection"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
headers := abstractions.NewRequestHeaders()
headers.Add("User-Agent", "ContosoLOBApp/1.0")
configuration := &graphinformationprotection.InformationProtectionPolicyLabelsEvaluateRemovalRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphinformationprotection.NewEvaluateRemovalPostRequestBody()
contentInfo := graphmodels.NewContentInfo()
format := graphmodels.DEFAULT_CONTENTFORMAT
contentInfo.SetFormat(&format)
identifier := null
contentInfo.SetIdentifier(&identifier)
state := graphmodels.REST_CONTENTSTATE
contentInfo.SetState(&state)
keyValuePair := graphmodels.NewKeyValuePair()
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled"
keyValuePair.SetName(&name)
value := "True"
keyValuePair.SetValue(&value)
keyValuePair1 := graphmodels.NewKeyValuePair()
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method"
keyValuePair1.SetName(&name)
value := "Standard"
keyValuePair1.SetValue(&value)
keyValuePair2 := graphmodels.NewKeyValuePair()
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate"
keyValuePair2.SetName(&name)
value := "1/1/0001 12:00:00 AM"
keyValuePair2.SetValue(&value)
keyValuePair3 := graphmodels.NewKeyValuePair()
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId"
keyValuePair3.SetName(&name)
value := "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
keyValuePair3.SetValue(&value)
keyValuePair4 := graphmodels.NewKeyValuePair()
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name"
keyValuePair4.SetName(&name)
value := "General"
keyValuePair4.SetValue(&value)
keyValuePair5 := graphmodels.NewKeyValuePair()
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits"
keyValuePair5.SetName(&name)
value := "0"
keyValuePair5.SetValue(&value)
keyValuePair6 := graphmodels.NewKeyValuePair()
name := "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId"
keyValuePair6.SetName(&name)
value := "00000000-0000-0000-0000-000000000000"
keyValuePair6.SetValue(&value)
metadata := []graphmodels.KeyValuePairable {
keyValuePair,
keyValuePair1,
keyValuePair2,
keyValuePair3,
keyValuePair4,
keyValuePair5,
keyValuePair6,
}
contentInfo.SetMetadata(metadata)
additionalData := map[string]interface{}{
"format@odata.type" : "#microsoft.graph.contentFormat",
"state@odata.type" : "#microsoft.graph.contentState",
"metadata@odata.type" : "#Collection(microsoft.graph.keyValuePair)",
}
contentInfo.SetAdditionalData(additionalData)
requestBody.SetContentInfo(contentInfo)
downgradeJustification := graphmodels.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
evaluateRemoval, err := graphClient.InformationProtection().Policy().Labels().EvaluateRemoval().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.informationprotection.policy.labels.evaluateremoval.EvaluateRemovalPostRequestBody evaluateRemovalPostRequestBody = new com.microsoft.graph.beta.informationprotection.policy.labels.evaluateremoval.EvaluateRemovalPostRequestBody();
ContentInfo contentInfo = new ContentInfo();
contentInfo.setOdataType("#microsoft.graph.contentInfo");
contentInfo.setFormat(ContentFormat.Default);
contentInfo.setIdentifier(null);
contentInfo.setState(ContentState.Rest);
LinkedList<KeyValuePair> metadata = new LinkedList<KeyValuePair>();
KeyValuePair keyValuePair = new KeyValuePair();
keyValuePair.setOdataType("#microsoft.graph.keyValuePair");
keyValuePair.setName("MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled");
keyValuePair.setValue("True");
metadata.add(keyValuePair);
KeyValuePair keyValuePair1 = new KeyValuePair();
keyValuePair1.setOdataType("#microsoft.graph.keyValuePair");
keyValuePair1.setName("MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method");
keyValuePair1.setValue("Standard");
metadata.add(keyValuePair1);
KeyValuePair keyValuePair2 = new KeyValuePair();
keyValuePair2.setOdataType("#microsoft.graph.keyValuePair");
keyValuePair2.setName("MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate");
keyValuePair2.setValue("1/1/0001 12:00:00 AM");
metadata.add(keyValuePair2);
KeyValuePair keyValuePair3 = new KeyValuePair();
keyValuePair3.setOdataType("#microsoft.graph.keyValuePair");
keyValuePair3.setName("MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId");
keyValuePair3.setValue("cfa4cf1d-a337-4481-aa99-19d8f3d63f7c");
metadata.add(keyValuePair3);
KeyValuePair keyValuePair4 = new KeyValuePair();
keyValuePair4.setOdataType("#microsoft.graph.keyValuePair");
keyValuePair4.setName("MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name");
keyValuePair4.setValue("General");
metadata.add(keyValuePair4);
KeyValuePair keyValuePair5 = new KeyValuePair();
keyValuePair5.setOdataType("#microsoft.graph.keyValuePair");
keyValuePair5.setName("MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits");
keyValuePair5.setValue("0");
metadata.add(keyValuePair5);
KeyValuePair keyValuePair6 = new KeyValuePair();
keyValuePair6.setOdataType("#microsoft.graph.keyValuePair");
keyValuePair6.setName("MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId");
keyValuePair6.setValue("00000000-0000-0000-0000-000000000000");
metadata.add(keyValuePair6);
contentInfo.setMetadata(metadata);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("format@odata.type", "#microsoft.graph.contentFormat");
additionalData.put("state@odata.type", "#microsoft.graph.contentState");
additionalData.put("metadata@odata.type", "#Collection(microsoft.graph.keyValuePair)");
contentInfo.setAdditionalData(additionalData);
evaluateRemovalPostRequestBody.setContentInfo(contentInfo);
DowngradeJustification downgradeJustification = new DowngradeJustification();
downgradeJustification.setJustificationMessage("The information has been declassified.");
downgradeJustification.setIsDowngradeJustified(true);
evaluateRemovalPostRequestBody.setDowngradeJustification(downgradeJustification);
var result = graphClient.informationProtection().policy().labels().evaluateRemoval().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.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: 'General'
},
{
'@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'
}
]
},
downgradeJustification: {
justificationMessage: 'The information has been declassified.',
isDowngradeJustified: true
}
};
await client.api('/informationProtection/policy/labels/evaluateRemoval')
.version('beta')
.post(informationProtectionAction);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\InformationProtection\Policy\Labels\EvaluateRemoval\EvaluateRemovalRequestBuilderPostRequestConfiguration;
use Microsoft\Graph\Beta\Generated\InformationProtection\Policy\Labels\EvaluateRemoval\EvaluateRemovalPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\ContentInfo;
use Microsoft\Graph\Beta\Generated\Models\ContentFormat;
use Microsoft\Graph\Beta\Generated\Models\ContentState;
use Microsoft\Graph\Beta\Generated\Models\KeyValuePair;
use Microsoft\Graph\Beta\Generated\Models\DowngradeJustification;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EvaluateRemovalPostRequestBody();
$contentInfo = new ContentInfo();
$contentInfo->setOdataType('#microsoft.graph.contentInfo');
$contentInfo->setFormat(new ContentFormat('default'));
$contentInfo->setIdentifier(null);
$contentInfo->setState(new ContentState('rest'));
$metadataKeyValuePair1 = new KeyValuePair();
$metadataKeyValuePair1->setOdataType('#microsoft.graph.keyValuePair');
$metadataKeyValuePair1->setName('MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled');
$metadataKeyValuePair1->setValue('True');
$metadataArray []= $metadataKeyValuePair1;
$metadataKeyValuePair2 = new KeyValuePair();
$metadataKeyValuePair2->setOdataType('#microsoft.graph.keyValuePair');
$metadataKeyValuePair2->setName('MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method');
$metadataKeyValuePair2->setValue('Standard');
$metadataArray []= $metadataKeyValuePair2;
$metadataKeyValuePair3 = new KeyValuePair();
$metadataKeyValuePair3->setOdataType('#microsoft.graph.keyValuePair');
$metadataKeyValuePair3->setName('MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate');
$metadataKeyValuePair3->setValue('1/1/0001 12:00:00 AM');
$metadataArray []= $metadataKeyValuePair3;
$metadataKeyValuePair4 = new KeyValuePair();
$metadataKeyValuePair4->setOdataType('#microsoft.graph.keyValuePair');
$metadataKeyValuePair4->setName('MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId');
$metadataKeyValuePair4->setValue('cfa4cf1d-a337-4481-aa99-19d8f3d63f7c');
$metadataArray []= $metadataKeyValuePair4;
$metadataKeyValuePair5 = new KeyValuePair();
$metadataKeyValuePair5->setOdataType('#microsoft.graph.keyValuePair');
$metadataKeyValuePair5->setName('MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name');
$metadataKeyValuePair5->setValue('General');
$metadataArray []= $metadataKeyValuePair5;
$metadataKeyValuePair6 = new KeyValuePair();
$metadataKeyValuePair6->setOdataType('#microsoft.graph.keyValuePair');
$metadataKeyValuePair6->setName('MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits');
$metadataKeyValuePair6->setValue('0');
$metadataArray []= $metadataKeyValuePair6;
$metadataKeyValuePair7 = new KeyValuePair();
$metadataKeyValuePair7->setOdataType('#microsoft.graph.keyValuePair');
$metadataKeyValuePair7->setName('MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId');
$metadataKeyValuePair7->setValue('00000000-0000-0000-0000-000000000000');
$metadataArray []= $metadataKeyValuePair7;
$contentInfo->setMetadata($metadataArray);
$additionalData = [
'format@odata.type' => '#microsoft.graph.contentFormat',
'state@odata.type' => '#microsoft.graph.contentState',
'metadata@odata.type' => '#Collection(microsoft.graph.keyValuePair)',
];
$contentInfo->setAdditionalData($additionalData);
$requestBody->setContentInfo($contentInfo);
$downgradeJustification = new DowngradeJustification();
$downgradeJustification->setJustificationMessage('The information has been declassified.');
$downgradeJustification->setIsDowngradeJustified(true);
$requestBody->setDowngradeJustification($downgradeJustification);
$requestConfiguration = new EvaluateRemovalRequestBuilderPostRequestConfiguration();
$headers = [
'User-Agent' => 'ContosoLOBApp/1.0',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->informationProtection()->policy()->labels()->evaluateRemoval()->post($requestBody, $requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.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 = "General"
}
@{
"@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"
}
)
}
downgradeJustification = @{
justificationMessage = "The information has been declassified."
isDowngradeJustified = $true
}
}
Test-MgBetaInformationProtectionPolicyLabelRemoval -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.information_protection.policy.labels.evaluate_removal.evaluate_removal_request_builder import EvaluateRemovalRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
from msgraph_beta.generated.informationprotection.policy.labels.evaluate_removal.evaluate_removal_post_request_body import EvaluateRemovalPostRequestBody
from msgraph_beta.generated.models.content_info import ContentInfo
from msgraph_beta.generated.models.content_format import ContentFormat
from msgraph_beta.generated.models.content_state import ContentState
from msgraph_beta.generated.models.key_value_pair import KeyValuePair
from msgraph_beta.generated.models.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.contentInfo",
format = ContentFormat.Default,
identifier = None,
state = ContentState.Rest,
metadata = [
KeyValuePair(
odata_type = "#microsoft.graph.keyValuePair",
name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled",
value = "True",
),
KeyValuePair(
odata_type = "#microsoft.graph.keyValuePair",
name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method",
value = "Standard",
),
KeyValuePair(
odata_type = "#microsoft.graph.keyValuePair",
name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate",
value = "1/1/0001 12:00:00 AM",
),
KeyValuePair(
odata_type = "#microsoft.graph.keyValuePair",
name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId",
value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c",
),
KeyValuePair(
odata_type = "#microsoft.graph.keyValuePair",
name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name",
value = "General",
),
KeyValuePair(
odata_type = "#microsoft.graph.keyValuePair",
name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits",
value = "0",
),
KeyValuePair(
odata_type = "#microsoft.graph.keyValuePair",
name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId",
value = "00000000-0000-0000-0000-000000000000",
),
],
additional_data = {
"format@odata_type" : "#microsoft.graph.contentFormat",
"state@odata_type" : "#microsoft.graph.contentState",
"metadata@odata_type" : "#Collection(microsoft.graph.keyValuePair)",
}
),
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.information_protection.policy.labels.evaluate_removal.post(request_body, request_configuration = request_configuration)