sensitivityLabel: evaluateApplication

命名空间: microsoft.graph.security

重要

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

计算应应用的 敏感度标签 ,并返回为正确标记信息而必须采取的一组操作。 当标签应该由用户或服务手动或显式设置(而不是根据文件内容自动设置)时,此 API 非常有用。

给定 contentInfo(包括现有内容元数据 键值对)和 labelingOptions 作为输入,API 将返回包含以下多项之一的 informationProtectionAction 对象:

API 可用性

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

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

权限

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

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

HTTP 请求

若要评估为已登录用户 (委派的权限) 或指定的用户 (应用程序权限) :

POST /users/{usersId}/security/informationProtection/sensitivityLabels/evaluateApplication
POST /me/security/informationProtection/sensitivityLabels/evaluateApplication

若要评估为服务主体 (应用程序权限) :

POST /security/informationProtection/sensitivityLabels/evaluateApplication

请求标头

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

请求正文

在请求正文中,提供参数的 JSON 表示形式。

下表显示了可用于此操作的参数。

参数 类型 说明
contentInfo contentInfo 以键值对的形式提供有关内容格式、内容状态和现有 元数据 的详细信息。
labelingOptions labelingOptions 提供有关内容的所需状态的详细信息。

响应

如果成功,此操作将在响应正文中返回 200 OK 响应代码和 informationProtectionAction 集合。

示例

请求

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

POST https://graph.microsoft.com/beta/users/bob@contoso.com/security/informationProtection/sensitivityLabels/evaluateApplication
Content-Type: application/json
Content-length: 181
User-agent: ContosoLobApp/1.0

{
    "contentInfo": {
        "@odata.type": "#microsoft.graph.security.contentInfo",
        "format@odata.type": "#microsoft.graph.security.contentFormat",
        "contentFormat": "File",
        "format": "default",
        "identifier": null,
        "state@odata.type": "#microsoft.graph.security.contentState",
        "state": "rest",
        "metadata@odata.type": "#Collection(microsoft.graph.security.keyValuePair)",
        "metadata": [
            {
                "@odata.type": "#microsoft.graph.security.keyValuePair",
                "name": "MSIP_Label_3a80e051-487c-40d4-b491-73ad25d997e6_Enabled",
                "value": "True"
            },
            {
                "@odata.type": "#microsoft.graph.security.keyValuePair",
                "name": "MSIP_Label_3a80e051-487c-40d4-b491-73ad25d997e6_Method",
                "value": "Standard"
            },
            {
                "@odata.type": "#microsoft.graph.security.keyValuePair",
                "name": "MSIP_Label_3a80e051-487c-40d4-b491-73ad25d997e6_SetDate",
                "value": "1/1/0001 12:00:00 AM"
            },
            {
                "@odata.type": "#microsoft.graph.security.keyValuePair",
                "name": "MSIP_Label_3a80e051-487c-40d4-b491-73ad25d997e6_SiteId",
                "value": "cfa4cf1d-a337-4481-aa99-19d8f3d63f7c"
            },
            {
                "@odata.type": "#microsoft.graph.security.keyValuePair",
                "name": "MSIP_Label_3a80e051-487c-40d4-b491-73ad25d997e6_Name",
                "value": "LabelScopedToBob_Tests"
            },
            {
                "@odata.type": "#microsoft.graph.security.keyValuePair",
                "name": "MSIP_Label_3a80e051-487c-40d4-b491-73ad25d997e6_ContentBits",
                "value": "0"
            },
            {
                "@odata.type": "#microsoft.graph.security.keyValuePair",
                "name": "MSIP_Label_3a80e051-487c-40d4-b491-73ad25d997e6_ActionId",
                "value": "00000000-0000-0000-0000-000000000000"
            }
        ]
    },
    "labelingOptions": {
        "@odata.type": "#microsoft.graph.security.labelingOptions",
        "assignmentMethod@odata.type": "#microsoft.graph.security.assignmentMethod",
        "assignmentMethod": "standard",
        "labelId@odata.type": "#Guid",
        "labelId": "836ff34f-b604-4a62-a68c-d6be4205d569",
        "downgradeJustification": {
            "justificationMessage": "Justified",
            "isDowngradeJustified": true
        },
        "extendedProperties@odata.type": "#Collection(microsoft.graph.security.keyValuePair)",
        "extendedProperties": []
    }
}

响应

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

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

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.security.informationProtectionAction)",
    "value": [
        {
            "@odata.type": "#microsoft.graph.security.addContentHeaderAction",
            "uiElementName": "MSIPCM_v1_header",
            "text": "HIGHLY CONFIDENTIAL",
            "fontName": "Calibri",
            "fontSize": 12,
            "fontColor": "#000000",
            "alignment": "left",
            "margin": 5
        },
        {
            "@odata.type": "#microsoft.graph.security.addWatermarkAction",
            "uiElementName": "MSIPWM_v1_main",
            "layout": "diagonal",
            "text": "HIGHLY CONFIDENTIAL",
            "fontName": "Calibri",
            "fontSize": 72,
            "fontColor": "#000000"
        },
        {
            "@odata.type": "#microsoft.graph.security.addContentFooterAction",
            "uiElementName": "MSIPCM_v1_footer",
            "text": "HIGHLY CONFIDENTIAL",
            "fontName": "Calibri",
            "fontSize": 12,
            "fontColor": "#000000",
            "alignment": "left",
            "margin": 5
        },
        {
            "@odata.type": "#microsoft.graph.security.protectByTemplateAction",
            "templateId": "684d0d40-83d4-4ce6-a5e7-0efb9fffb2dc"
        },
        {
            "@odata.type": "#microsoft.graph.security.metadataAction",
            "metadataToRemove": [],
            "metadataToAdd": [
                {
                    "name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Enabled",
                    "value": "true"
                },
                {
                    "name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SetDate",
                    "value": "2022-03-04T22:48:13Z"
                },
                {
                    "name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Method",
                    "value": "Standard"
                },
                {
                    "name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_Name",
                    "value": "FTEs_HC"
                },
                {
                    "name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_SiteId",
                    "value": "29375103-6ce7-4dba-81ec-8e33884c6f0f"
                },
                {
                    "name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ActionId",
                    "value": "14368e92-2e6a-46c4-9a48-5117de375b66"
                },
                {
                    "name": "MSIP_Label_836ff34f-b604-4a62-a68c-d6be4205d569_ContentBits",
                    "value": "15"
                }
            ]
        }
    ]
}