Office.Sensitivity interface

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Provides methods to get and set the sensitivity level of an appointment. To learn more about sensitivity levels, see Mark your email as Normal, Personal, Private, or Confidential.

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Methods

getAsync(options, callback)

Gets the sensitivity level of an appointment.

getAsync(callback)

Gets the sensitivity level of an appointment.

setAsync(sensitivity, options, callback)

Sets the sensitivity level of an appointment.

setAsync(sensitivity, callback)

Sets the sensitivity level of an appointment.

Method Details

getAsync(options, callback)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the sensitivity level of an appointment.

getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<MailboxEnums.AppointmentSensitivityType>) => void): void;

Parameters

options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties:- asyncContext: Developers can provide any object they wish to access in the callback function.

callback

(asyncResult: Office.AsyncResult<Office.MailboxEnums.AppointmentSensitivityType>) => void

When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. The sensitivity level of the appointment is returned in the asyncResult.value property.

Returns

void

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Important: Outlook on Mac, Outlook on the web, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels. If you call getAsync on an appointment that has a Confidential or Personal sensitivity level from these clients, the Normal sensitivity level is returned in the asyncResult.value property.

getAsync(callback)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the sensitivity level of an appointment.

getAsync(callback: (asyncResult: Office.AsyncResult<MailboxEnums.AppointmentSensitivityType>) => void): void;

Parameters

callback

(asyncResult: Office.AsyncResult<Office.MailboxEnums.AppointmentSensitivityType>) => void

When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object. The sensitivity level of the appointment is returned in the asyncResult.value property.

Returns

void

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Important: Outlook on Mac, Outlook on the web, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels. If you call getAsync on an appointment that has a Confidential or Personal sensitivity level from these clients, the Normal sensitivity level is returned in the asyncResult.value property.

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/calendar-properties-apis.yaml

Office.context.mailbox.item.sensitivity.getAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    console.log("Sensitivity: " + asyncResult.value);
  } else {
    console.log("Failed to get sensitivity: " + JSON.stringify(asyncResult.error));
  }
});

setAsync(sensitivity, options, callback)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sets the sensitivity level of an appointment.

setAsync(sensitivity: MailboxEnums.AppointmentSensitivityType | string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameters

sensitivity

Office.MailboxEnums.AppointmentSensitivityType | string

The sensitivity level as an enum or string.

options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties:- asyncContext: Developers can provide any object they wish to access in the callback function.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object.

Returns

void

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read/write item

Applicable Outlook mode: Compose

Important: Outlook on Mac, Outlook on the web, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels.

Errors:

  • Unsupported API parameter: Setting the sensitivity level of an appointment isn't supported.

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/calendar-properties-apis.yaml

Office.context.mailbox.item.sensitivity.setAsync(
  Office.MailboxEnums.AppointmentSensitivityType.Confidential,
  function callback(asyncResult) {
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
      console.log("Failed to set appointment sensitivity: " + JSON.stringify(asyncResult.error));
    } else {
      console.log("Successfully set appointment sensitivity.");
    }
  }
);

setAsync(sensitivity, callback)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sets the sensitivity level of an appointment.

setAsync(sensitivity: MailboxEnums.AppointmentSensitivityType | string, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameters

sensitivity

Office.MailboxEnums.AppointmentSensitivityType | string

The sensitivity level as an enum or string.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object.

Returns

void

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read/write item

Applicable Outlook mode: Compose

Important: Outlook on Mac, Outlook on the web, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels.

Errors:

  • Unsupported API parameter: Setting the sensitivity level of an appointment isn't supported.