APIs unter der /beta Version in Microsoft Graph können geändert werden. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in Version 1.0 verfügbar ist, verwenden Sie die Versionsauswahl .
Berechnen Sie die Bezeichnung für den Informationsschutz , die angewendet werden soll, und geben Sie den Satz von Aktionen zurück, die ausgeführt werden müssen, um die Informationen korrekt zu bezeichnen. Diese API ist nützlich, wenn eine Bezeichnung manuell oder explizit von einem Benutzer oder Dienst festgelegt werden sollte, anstatt automatisch auf der Grundlage von Dateiinhalten.
Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie im Artikel zum Thema Berechtigungen.
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
InformationProtectionPolicy.Read
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Anwendung
InformationProtectionPolicy.Read.All
HTTP-Anforderung
POST me/informationProtection/policy/labels/evaluateApplication
POST /users/{id}/informationProtection/policy/labels/evaluateApplication
Anforderungsheader
Name
Beschreibung
Authorization
Bearer {token}. Erforderlich.
Content-type
application/json. Erforderlich.
User-Agent
Beschreibt den Namen der aufrufenden Anwendung. Details werden in Azure Information Protection Analytics angezeigt. Das vorgeschlagene Format ist ApplicationName/Version. Optional.
Anforderungstext
Geben Sie im Anforderungstext ein JSON-Objekt mit den folgenden Parametern an.
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 = "General"
},
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)"}
}
};
var labelingOptions = new LabelingOptions
{
AssignmentMethod = AssignmentMethod.Standard,
LabelId = "97309856-9c28-4ac6-9382-5f8bc20c457b",
DowngradeJustification = null,
ExtendedProperties = new List<KeyValuePair>()
{
},
AdditionalData = new Dictionary<string, object>()
{
{"assignmentMethod@odata.type", "#microsoft.graph.assignmentMethod"},
{"labelId@odata.type", "#Guid"},
{"extendedProperties@odata.type", "#Collection(microsoft.graph.keyValuePair)"}
}
};
await graphClient.InformationProtection.Policy.Labels
.EvaluateApplication(contentInfo,labelingOptions)
.Request()
.Header("User-Agent","ContosoLOBApp/1.0")
.PostAsync();
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
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.additionalDataManager().put("format@odata.type", new JsonPrimitive("#microsoft.graph.contentFormat"));
contentInfo.format = ContentFormat.DEFAULT;
contentInfo.identifier = null;
contentInfo.additionalDataManager().put("state@odata.type", new JsonPrimitive("#microsoft.graph.contentState"));
contentInfo.state = ContentState.REST;
contentInfo.additionalDataManager().put("metadata@odata.type", new JsonPrimitive("#Collection(microsoft.graph.keyValuePair)"));
LinkedList<KeyValuePair> metadataList = new LinkedList<KeyValuePair>();
KeyValuePair metadata = new KeyValuePair();
metadata.name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled";
metadata.value = "True";
metadataList.add(metadata);
KeyValuePair metadata1 = new KeyValuePair();
metadata1.name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method";
metadata1.value = "Standard";
metadataList.add(metadata1);
KeyValuePair metadata2 = new KeyValuePair();
metadata2.name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate";
metadata2.value = "1/1/0001 12:00:00 AM";
metadataList.add(metadata2);
KeyValuePair metadata3 = new KeyValuePair();
metadata3.name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId";
metadata3.value = "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c";
metadataList.add(metadata3);
KeyValuePair metadata4 = new KeyValuePair();
metadata4.name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name";
metadata4.value = "General";
metadataList.add(metadata4);
KeyValuePair metadata5 = new KeyValuePair();
metadata5.name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits";
metadata5.value = "0";
metadataList.add(metadata5);
KeyValuePair metadata6 = new KeyValuePair();
metadata6.name = "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId";
metadata6.value = "00000000-0000-0000-0000-000000000000";
metadataList.add(metadata6);
contentInfo.metadata = metadataList;
LabelingOptions labelingOptions = new LabelingOptions();
labelingOptions.additionalDataManager().put("assignmentMethod@odata.type", new JsonPrimitive("#microsoft.graph.assignmentMethod"));
labelingOptions.assignmentMethod = AssignmentMethod.STANDARD;
labelingOptions.additionalDataManager().put("labelId@odata.type", new JsonPrimitive("#Guid"));
labelingOptions.labelId = "97309856-9c28-4ac6-9382-5f8bc20c457b";
labelingOptions.downgradeJustification = null;
labelingOptions.additionalDataManager().put("extendedProperties@odata.type", new JsonPrimitive("#Collection(microsoft.graph.keyValuePair)"));
LinkedList<KeyValuePair> extendedPropertiesList = new LinkedList<KeyValuePair>();
labelingOptions.extendedProperties = extendedPropertiesList;
graphClient.informationProtection().policy().labels()
.evaluateApplication(InformationProtectionLabelEvaluateApplicationParameterSet
.newBuilder()
.withContentInfo(contentInfo)
.withLabelingOptions(labelingOptions)
.build())
.buildRequest( requestOptions )
.post();
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
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 := "General"
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)",
}
labelingOptions := msgraphsdk.NewLabelingOptions()
requestBody.SetLabelingOptions(labelingOptions)
assignmentMethod := "standard"
labelingOptions.SetAssignmentMethod(&assignmentMethod)
labelId := "97309856-9c28-4ac6-9382-5f8bc20c457b"
labelingOptions.SetLabelId(&labelId)
labelingOptions.SetDowngradeJustification(nil)
labelingOptions.SetExtendedProperties( []KeyValuePair {
}
labelingOptions.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.labelingOptions",
"assignmentMethod@odata.type": "#microsoft.graph.assignmentMethod",
"labelId@odata.type": "#Guid",
"extendedProperties@odata.type": "#Collection(microsoft.graph.keyValuePair)",
}
headers := map[string]string{
"User-Agent": "ContosoLOBApp/1.0"
}
options := &msgraphsdk.EvaluateApplicationRequestBuilderPostRequestConfiguration{
Headers: headers,
}
result, err := graphClient.InformationProtection().Policy().Labels().EvaluateApplication().PostWithRequestConfigurationAndResponseHandler(requestBody, options, nil)
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
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 = "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"
}
)
}
LabelingOptions = @{
"@odata.type" = "#microsoft.graph.labelingOptions"
"AssignmentMethod@odata.type" = "#microsoft.graph.assignmentMethod"
AssignmentMethod = "standard"
"LabelId@odata.type" = "#Guid"
LabelId = "97309856-9c28-4ac6-9382-5f8bc20c457b"
DowngradeJustification = $null
"ExtendedProperties@odata.type" = "#Collection(microsoft.graph.keyValuePair)"
ExtendedProperties = @(
)
}
}
Test-MgInformationProtectionPolicyLabelApplication -BodyParameter $params
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.