Edit

Share via


Use the Microsoft Graph REST API from an Outlook add-in

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.

  • version specifies the v1.0 or beta 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