2

I'm designing an Outlook add-in and need to determine whether a selected message is part of a thread. Ideally, I'd also like to find related messages in said thread as well. Reading over the documentation, the conversationId property looks promising, though there doesn't seem to be a way to "get messages by conversationId."

Under the current version (1.4, non-preview) of the Outlook Add-in API, is it possible to detect that a message is part of a thread using the JavaScript API? Is it possible to then find other messages in the same thread?

nsturdivant
  • 273
  • 2
  • 10

1 Answers1

2
  • ConversationId is part of the javascript API. This means that you can know the ConversationId for the Office.context.mailbox.item whose your add-in is focusing on. See documentation here

  • To my knowledge, there is no way to retrieve all mails for a given ConversationId using vanilla javascript and Office.js.

However, you may be interested in my answer here.

When something is not available with Office.js api for an Outlook Add-in you can try to use the Exchange Web Services (EWS) or REST APIs to perform the action

You have basically two ways to request EWS from a mail add-in.

For the specific case of retrieving conversations using the Outlook REST API, this answer may also be helpful.

Community
  • 1
  • 1
Benoit Patra
  • 4,355
  • 5
  • 30
  • 53
  • 1
    The fact that conversationId is documented in the 1.4 API documentation (https://dev.outlook.com/reference/add-ins/Office.context.mailbox.item.html#conversationId) means that it's part of the JavaScript API, no? Seems odd for it not to be. +1 on the EWS suggestion; I think even if conversationId is what I think it is, I'd still have to leverage EWS to get the related messages. – nsturdivant Feb 13 '17 at 14:22
  • 1
    Oh sorry I did not check the documentation on 1.4... my bad. I keep the answer because it may be useful for others. So what you are looking for is not retrieving the conversationID of a mail but all mail to this thread. You may be interested by this http://stackoverflow.com/questions/41125652/fetch-messages-filtered-by-conversationid-via-office365-api/41131045#41131045 – Benoit Patra Feb 13 '17 at 15:45
  • please update your answer to A. reflect that conversationId is part of the JavaScript API and that B. there is not (yet) a native JavaScript API hook for retrieving related messages, and I'll accept your answer. – nsturdivant Feb 13 '17 at 16:11