Office.NotificationMessages interface

The NotificationMessages object is returned as the notificationMessages property of an item.

[ API set: Mailbox 1.3 ]

Remarks

Minimum permission levelReadItem
Applicable Outlook modeCompose or read

Methods

addAsync(key, JSONmessage, options, callback)

Adds a notification to an item.

There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error.

getAllAsync(options, callback)

Returns all keys and messages for an item.

[ API set: Mailbox 1.3 ]

removeAsync(key, options, callback)

Removes a notification message for an item.

[ API set: Mailbox 1.3 ]

replaceAsync(key, JSONmessage, options, callback)

Replaces a notification message that has a given key with another message.

If a notification message with the specified key doesn't exist, replaceAsync will add the notification.

[ API set: Mailbox 1.3 ]

Method Details

addAsync(key, JSONmessage, options, callback)

Adds a notification to an item.

There are a maximum of 5 notifications per message. Setting more will return a NumberOfNotificationMessagesExceeded error.

addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
Parameters
key
string

A developer-specified key used to reference this notification message. Developers can use it to modify this message later. It can't be longer than 32 characters.

JSONmessage
NotificationMessageDetails

A JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object.

options
Office.AsyncContextOptions

Optional. 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 method.

callback
(result: AsyncResult) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. [Api set: Mailbox 1.3]

Returns
void
Remarks
Minimum permission levelReadItem
Applicable Outlook modeCompose or read

In addition to this signature, the method also has the following signatures:

addAsync(key: string, JSONmessage: NotificationMessageDetails): void;

addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;

addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;

getAllAsync(options, callback)

Returns all keys and messages for an item.

[ API set: Mailbox 1.3 ]

getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
Parameters
options
Office.AsyncContextOptions

Optional. 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 method.

callback
(result: AsyncResult) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.

Returns
void
Remarks
Minimum permission levelReadItem
Applicable Outlook modeCompose or read

In addition to the main signature, this method also has this signature:

getAllAsync(callback: (result: AsyncResult) => void): void;

removeAsync(key, options, callback)

Removes a notification message for an item.

[ API set: Mailbox 1.3 ]

removeAsync(key: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
Parameters
key
string

The key for the notification message to remove.

options
Office.AsyncContextOptions

Optional. 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 method.

callback
(result: AsyncResult) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.

Returns
void
Remarks
Minimum permission levelReadItem
Applicable Outlook modeCompose or read

In addition to the main signature, this method also has these signatures:

removeAsync(key: string): void;

removeAsync(key: string, options: Office.AsyncContextOptions): void;

removeAsync(key: string, callback: (result: AsyncResult) => void): void;

replaceAsync(key, JSONmessage, options, callback)

Replaces a notification message that has a given key with another message.

If a notification message with the specified key doesn't exist, replaceAsync will add the notification.

[ API set: Mailbox 1.3 ]

replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
Parameters
key
string

The key for the notification message to replace. It can't be longer than 32 characters.

JSONmessage
NotificationMessageDetails

A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object.

options
Office.AsyncContextOptions

Optional. 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 method.

callback
(result: AsyncResult) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.

Returns
void
Remarks
Minimum permission levelReadItem
Applicable Outlook modeCompose or read

In addition to the main signature, this method also has these signatures:

replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void;

replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions): void;

replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;