I have build an Outlook OWA Add-In which is for both web and desktop application. There is a module where I have used "Office.context.mailbox.item.getAllInternetHeadersAsync()" to fetch headers of the mail which works perfectly on web version of outlook but when the same Add-In is loaded on the desktop version the code breaks because of mailbox version(1.4 or <1.8) compatiblity. As "getAllInternetHeadersAsync" is availble from mailbox version 1.8.
Is there any way that I can use to fetch the mail headers using Office.js javascript API? Other than Graph API, Office365 API or any other REST API.
Any help will be deeply appreciated. Thanks in advance.
The internetHeaders API for the Desktop client was introduced in requirement set 1.8. This means that all clients that support a requirement set <= 1.7 cannot use this API. The only solution here is to upgrade to a newer client.
If you want to use REST/Graph APIs to retrieve the internet headers of a received message, you can do that by adding the $select=internetMessageHeaders query to your REST call for fetching the message. See example 2 on this documentation page : https://docs.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0&tabs=http#examples