Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Outlook JavaScript API (Office.js) retrieves the properties of messages and appointments and run operations on these items in your add-in. However, there may be instances where the data you need isn't available through the API. For example, your add-in may need to implement single sign-on or identify messages in a user's mailbox that originated from the same sender. To get the information you need, use the Outlook mail REST API through Microsoft Graph.
Get started
To make calls to the Microsoft Graph API in Office Add-ins, implement the nested app authentication (NAA) solution to request a token.
Important
Legacy Exchange Online user identity tokens and callback tokens are no longer supported and turned off across all Microsoft 365 tenants. If an Outlook add-in requires delegated user access or user identity, we recommend using MSAL (Microsoft Authentication Library) and nested app authentication. Exchange user identity tokens are still supported for Exchange on-premises.
Call the Microsoft Graph API
Once you have an access token, you can then use it to call Microsoft Graph.
The Microsoft Graph API consists of the v1.0 and beta endpoints. Note the following about the endpoint pattern.
versionspecifies thev1.0orbetaAPI.resourcespecifies the resource your add-in interacts with, such as a user, group, or site.query_parametersspecifies parameters to customize your request. For example, you can filter the messages returned to only those from a specific sender.
https://graph.microsoft.com/[version]/[resource]?[query_parameters]
For more information on the Microsoft Graph API and its components, see Use the Microsoft Graph API.
See also
Office Add-ins