An Office service that supports add-ins to interact with objects in Office client applications.
Query regarding JavaScript API for calling Graph API from Outlook Add-in Iframe
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
Using classic Outlook for Windows in business environments
Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms