Search code examples
outlookoffice-jsadd-inoutlook-web-addins

Outlook Add-in REST API In Shared Inbox Fails: ErrorInvalidMailboxItemId - Item Id doesn't belong to the current mailbox


We have an Outlook (Office JS) Add-in with a manifest configured to support shared folders, i.e.

<SupportsSharedFolders>true</SupportsSharedFolders>

The add-in has been running flawlessly, for many months, on a number of machines that meet the minimum requirement set of 1.8 for shared folder support. Since 22-Apr-2020 it has returned the following error when selecting an email in a shared email inbox:

Status Code: 404
ErrorInvalidMailboxItemId - Item Id doesn't belong to the current mailbox

The REST API call that returns this error is:

https://outlook.office.com/api/v2.0/me/messages/<RestID>/

Where <RestID> is created from: Office.context.mailbox.convertToRestId(Office.context.mailbox.item.itemId, Office.MailboxEnums.RestVersion.v2_0)

Has an API change been documented anywhere?

Do we need to modify our code?


Solution

  • This is not a recent change. The REST URL should be constructed based on the SharedProperties descrbied here https://learn.microsoft.com/en-us/javascript/api/outlook/office.sharedproperties?view=outlook-js-1.8 Note that the SharedProperties API is only available for shared items.