Office.SensitivityLabelDetails interface

Represents the properties of available sensitivity labels in Outlook.

Remarks

[ API set: Mailbox 1.13 ]

Minimum permission level: read/write item

Applicable Outlook mode: Compose

Important: To use the sensitivity label feature in your add-in, you must have a Microsoft 365 E5 subscription.

To learn more about how to manage sensitivity labels in your add-in, see Manage the sensitivity label of your message or appointment in compose mode.

Examples

// Check whether the catalog of sensitivity labels is enabled on the current mailbox.
Office.context.sensitivityLabelsCatalog.getIsEnabledAsync((asyncResult) => {
    // If the catalog is enabled, get all available sensitivity labels.
    if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value == true) {
        Office.context.sensitivityLabelsCatalog.getAsync((asyncResult) => {
            if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
                const catalog = asyncResult.value;
                console.log("Sensitivity Labels Catalog:");
                
                // Log the details of the available sensitivity labels to the console.
                catalog.forEach((sensitivityLabel) => {
                    console.log(`Name: ${sensitivityLabel.name}`);
                    console.log(`ID: ${sensitivityLabel.id}`);
                    console.log(`Tooltip: ${sensitivityLabel.tooltip}`);
                    console.log(`Color: ${sensitivityLabel.color}`);
                    console.log(`Sublabels: ${JSON.stringify(sensitivityLabel.children)}`);
                });
            } else {
                console.log("Action failed with error: " + asyncResult.error.message);
            }
        });
    } else {
        console.log("Action failed with error: " + asyncResult.error.message);
    }
});

Properties

children

The sublabels of the sensitivity label. Returns null if a label doesn't have any sublabels.

color

The color of the sensitivity label.

id

The unique identifier (GUID) of the sensitivity label.

name

The name of the sensitivity label.

tooltip

The description of the sensitivity label.

Property Details

children

The sublabels of the sensitivity label. Returns null if a label doesn't have any sublabels.

children: SensitivityLabelDetails[];

Property Value

color

The color of the sensitivity label.

color: string;

Property Value

string

id

The unique identifier (GUID) of the sensitivity label.

id: string;

Property Value

string

name

The name of the sensitivity label.

name: string;

Property Value

string

tooltip

The description of the sensitivity label.

tooltip: string;

Property Value

string