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 tokens are deprecated. Legacy Exchange user identity and callback tokens have been turned off for most Exchange Online tenants. Administrators can reenable legacy tokens for tenants and add-ins until June 2025. In October 2025, legacy tokens will be completely turned off for all tenants. For the timeline and details, see our FAQ page. This is part of Microsoft's Secure Future Initiative, which gives organizations the tools needed to respond to the current threat landscape. Exchange user identity tokens will still work for Exchange on-premises. Nested app authentication is the recommended approach for tokens going forward.
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.
version
specifies thev1.0
orbeta
API.resource
specifies the resource your add-in interacts with, such as a user, group, or site.query_parameters
specifies 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