informationProtectionLabel: evaluateClassificationResults (已弃用)

命名空间:microsoft.graph

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

警告

信息保护标签 API 已弃用,并将自 2023 年 1 月 1 日起停止返回数据。 请使用新的 informationProtection、 sensitivityLabel 和关联资源。

使用 分类结果计算应应用 的信息保护标签 ,并返回为正确标记信息而必须采取的一组操作。 当应根据文件内容的分类自动设置标签(而不是由用户或服务直接标记)时,此 API 非常有用。

若要基于分类结果进行评估,请提供 contentInfo,其中包括现有的内容元数据 键/值对和 分类结果。 API 返回包含以下其中一项的 informationProtectionAction :

API 可用性

此 API 可用于以下国家级云部署。

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国
✅ ❌ ❌ ❌

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) InformationProtectionPolicy.Read 不可用。
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 InformationProtectionPolicy.Read.All 不可用。

HTTP 请求

POST /informationProtection/policy/labels/evaluateClassificationResults

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权。
Content-type application/json. 必需。
User-Agent 描述调用应用程序的名称和版本。 详细信息将在 Azure 信息保护分析中显示。 建议的格式为 ApplicationName/Version。 可选。

请求正文

在请求正文中,提供具有以下参数的 JSON 对象。

参数 类型 说明
contentInfo contentInfo 以键/值对的形式提供有关内容格式、内容状态和现有 元数据 的详细信息。
classificationResults classificationResult 集合 包含数据分类终结点返回的分类结果集。 分类信息用于根据 Microsoft 365 安全与合规中心中的 Microsoft Purview 信息保护策略标签配置确定相应的标签。

响应

如果成功,此方法将在响应正文中返回 200 OK 响应代码和新的 informationProtectionAction 集合对象。

示例

以下示例演示如何调用此 API。

请求

以下示例显示了一个请求。

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
    }
  ]
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

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"
            }
          ]
        }
      ]
    }
  ]
}