sensitivityLabel: evaluateApplication

Namespace: microsoft.graph.security

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Compute the sensitivity label that should be applied and return the set of actions that must be taken to correctly label the information. This API is useful when a label should be set manually or explicitly by a user or service, rather than automatically based on file contents.

Given contentInfo, which includes existing content metadata key-value pairs, and labelingOptions as an input, the API returns an informationProtectionAction object that contains one of more of the following:

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) InformationProtectionPolicy.Read Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application InformationProtectionPolicy.Read.All Not available.

HTTP request

To evaluate as the signed-in user (delegated permission) or a specified user (application permission):

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

To evaluate as a service principal (application permission):

POST /security/informationProtection/sensitivityLabels/evaluateApplication

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-type application/json. Required.
User-Agent Describes the name of the calling application. Details will surface in Azure Information Protection Analytics. Suggested format is ApplicationName/Version. Optional.

Request body

In the request body, supply a JSON representation of the parameters.

The following table shows the parameters that can be used with this action.

Parameter Type Description
contentInfo contentInfo Provides details on the content format, content state, and existing metadata as key-value pairs.
labelingOptions labelingOptions Provides details about the desired state of the content.

Response

If successful, this action returns a 200 OK response code and an informationProtectionAction collection in the response body.

Examples

Request

The following example shows a request.

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

Response

The following example shows the response.

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