informationProtectionLabel: evaluateClassificationResultsinformationProtectionLabel: evaluateClassificationResults

命名空间:microsoft.graphNamespace: microsoft.graph

重要

/betaMicrosoft Graph 中的版本下的 api 可能会发生更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported. 若要确定 API 在 v1.0 中是否可用,请使用 版本 选择器。To determine whether an API is available in v1.0, use the Version selector.

使用 分类结果,计算应应用的 信息保护标签 ,并返回为正确标记信息而必须采取的一组操作。Using classification results, compute the information protection label that should be applied and return the set of actions that must be taken to correctly label the information. 如果标签应根据文件内容的分类自动设置,而不是由用户或服务直接标记,则此 API 非常有用。This API is useful when a label should be set automatically based on classification of the file contents, rather than labeled directly by a user or service.

若要基于分类结果进行评估,请提供 contentInfo,其中包括现有的内容元数据 密钥/值对分类结果To evaluate based on classification results, provide contentInfo, which includes existing content metadata key/value pairs, and classification results. API 返回一个 informationProtectionAction ,其中包含以下一个或多个内容:The API returns an informationProtectionAction that contains one of more of the following:

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) InformationProtectionPolicy.ReadInformationProtectionPolicy.Read
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用程序Application InformationProtectionPolicy.Read.AllInformationProtectionPolicy.Read.All

HTTP 请求HTTP request

POST /informationprotection/policy/labels/{id}/evaluateClassificationResults

请求标头Request headers

名称Name 说明Description
AuthorizationAuthorization Bearer {token}。必需。Bearer {token}. Required.
Content-typeContent-type application/json. Required.application/json. Required.
用户代理User-Agent 描述调用应用程序的名称和版本。Describes the name and version of the calling application. 详细信息将在 Azure 信息保护分析中显现。Details will surface in Azure Information Protection Analytics. 建议的格式为 "ApplicationName/版本"。Suggested format is ApplicationName/Version. 可选。Optional.

请求正文Request body

在请求正文中,提供具有以下参数的 JSON 对象。In the request body, provide a JSON object with the following parameters.

参数Parameter 类型Type 说明Description
contentInfocontentInfo contentInfocontentInfo 提供有关内容格式、内容状态和现有 元数据 的详细信息,作为键/值对。Provides details about the content format, content state, and existing metadata as key/value pairs.
classificationResultsclassificationResults classificationResult 集合classificationResult collection 包含由数据分类终结点返回的一组分类结果。Contains the set of classification results returned by the data classification endpoint. 分类信息用于根据 Office 365 安全与合规中心中的 Microsoft 信息保护策略标签配置确定适当的标签。Classification information is used to determine the appropriate label based on the Microsoft Information Protection policy label configuration in Office 365 Security and Compliance Center.

响应Response

如果成功,此方法 200 OK 在响应正文中返回响应代码和新的 informationProtectionAction 集合对象。If successful, this method returns a 200 OK response code and a new informationProtectionAction collection object in the response body.

示例Examples

以下示例演示如何调用此 API。The following example shows how to call this API.

请求Request

下面展示了示例请求。The following is an example of the request.

POST https://graph.microsoft.com/beta/informationprotection/policy/labels/evaluateClassificationResults
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"
  },
  "classificationResults": [
    {
      "sensitiveTypeId": "cb353f78-2b72-4c3c-8827-92ebe4f69fdf",
      "count": 4,
      "confidenceLevel": 75
    }
  ]
}

响应Response

下面展示了示例响应。The following is an example of the response.

注意: 为了提高可读性,可能缩短了此处显示的响应对象。所有属性都将通过实际调用返回。Note: The response object shown here might be shortened for readability. All the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.informationProtectionAction)",
  "value": [
    {
      "@odata.type": "#microsoft.graph.applyLabelAction",
      "responsibleSensitiveTypeIds": [
        "cb353f78-2b72-4c3c-8827-92ebe4f69fdf"
      ],
      "actionSource": "automatic",
      "label": {
        "id": "722a5300-ac39-4c9a-88e3-f54c46676417",
        "name": "Top Secret",
        "description": "",
        "color": "#000000",
        "sensitivity": 13,
        "tooltip": "This information is Top Secret.",
        "isActive": true
      },
      "actions": [
        {
          "@odata.type": "#microsoft.graph.protectByTemplateAction",
          "templateId": "0e7fea72-7bba-4438-a070-95c292cd6f8c"
        },
        {
          "@odata.type": "#microsoft.graph.metadataAction",
          "metadataToRemove": [],
          "metadataToAdd": [
            {
              "name": "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Enabled",
              "value": "true"
            },
            {
              "name": "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SetDate",
              "value": "2019-10-03T21:50:20Z"
            },
            {
              "name": "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Method",
              "value": "Standard"
            },
            {
              "name": "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_Name",
              "value": "Top Secret"
            },
            {
              "name": "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_SiteId",
              "value": "cb46c030-1825-4e81-a295-151c039dbf02"
            },
            {
              "name": "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ActionId",
              "value": "76dc494e-6c59-43e6-88a1-0000edd58fca"
            },
            {
              "name": "MSIP_Label_722a5300-ac39-4c9a-88e3-f54c46676417_ContentBits",
              "value": "8"
            }
          ]
        }
      ]
    }
  ]
}