Share via

Query regarding JavaScript API for calling Graph API from Outlook Add-in Iframe

Soujanya KC 10 Reputation points
2023-06-27T06:39:52.61+00:00

Hello Microsoft Support,

We are currently developing Outlook Add-ins and have been using the https://outlook.office.com/api/v2.0/me/messages/{{Office.context.mailbox.item.itemId}}//attachments API to fetch attachment content for the current email. We obtain the token for this API using the JavaScript API Office.context.mailbox.getCallbackTokenAsync(callbackfunction).

We have noticed that the Outlook APIs are deprecated, and we are aware of the equivalent Graph API https://graph.microsoft.com/v1.0/me/messages/{{Office.context.mailbox.item.itemId}}/attachments. However, we have been unable to find a JavaScript API that allows us to fetch a one-time online token for calling the Graph API from the Outlook Add-ins iframe.

Our question is, does a JavaScript API exist that enables us to call the Graph API from within the Outlook Add-ins iframe?

We have been using https://appsforoffice.microsoft.com/lib/1.1/hosted/Office.js for the Outlook Add-in JavaScript APIs.

We would greatly appreciate any guidance or information you can provide regarding this matter. If there are any alternative solutions or workarounds to obtain a one-time online token for calling the Graph API, please let us know.

Thank you for your assistance.

Best regard,
Soujanya KC.

Microsoft 365 and Office | Development | Office JavaScript API
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.