Skip to content

Commit bb8919c

Browse files
samantharamonlindalu-MSFTdavidchesnut
authored
[Outlook] Update REST and Graph articles (#4971)
* Update REST deprecation note * Draft MS Graph article * Apply minor fixes * Update TOC * Apply suggestions from review Co-authored-by: Linda Cannon <[email protected]> * Apply suggestions from review Co-authored-by: David Chesnut <[email protected]> * Apply suggestions from review and update include --------- Co-authored-by: Linda Cannon <[email protected]> Co-authored-by: David Chesnut <[email protected]>
1 parent a46b631 commit bb8919c

File tree

4 files changed

+51
-7
lines changed

4 files changed

+51
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
> [!IMPORTANT]
2-
> Legacy Exchange tokens are deprecated. Starting February 2025, we'll begin to turn off legacy Exchange [user identity](../outlook/authentication.md#exchange-user-identity-token) and [callback](../outlook/authentication.md#callback-tokens) tokens for Exchange Online tenants. For the timeline and details, see our [FAQ page](../outlook/faq-nested-app-auth-outlook-legacy-tokens.md). This is part of [Microsoft's Secure Future Initiative](https://blogs.microsoft.com/on-the-issues/2023/11/02/secure-future-initiative-sfi-cybersecurity-cyberattacks/), 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.
2+
> Legacy Exchange tokens are deprecated. Legacy Exchange [user identity](../outlook/authentication.md#exchange-user-identity-token) and [callback](../outlook/authentication.md#callback-tokens) 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](../outlook/faq-nested-app-auth-outlook-legacy-tokens.md). This is part of [Microsoft's Secure Future Initiative](https://blogs.microsoft.com/on-the-issues/2023/11/02/secure-future-initiative-sfi-cybersecurity-cyberattacks/), 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.

docs/outlook/microsoft-graph.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Use the Microsoft Graph REST API from an Outlook add-in
3+
description: Learn how to use the Outlook mail REST API from an Outlook add-in with Microsoft Graph.
4+
ms.date: 04/22/2025
5+
ms.topic: how-to
6+
ms.localizationpriority: medium
7+
---
8+
9+
# Use the Microsoft Graph REST API from an Outlook add-in
10+
11+
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](/graph/api/resources/mail-api-overview) through [Microsoft Graph](/graph/overview).
12+
13+
## Get started
14+
15+
To make calls to the Microsoft Graph API in Office Add-ins, implement the [nested app authentication (NAA)](../develop/enable-nested-app-authentication-in-your-add-in.md) solution to request a token.
16+
17+
[!INCLUDE [legacy-exchange-token-deprecation](../includes/legacy-exchange-token-deprecation.md)]
18+
19+
## Call the Microsoft Graph API
20+
21+
Once you have an access token, you can then use it to call Microsoft Graph.
22+
23+
The Microsoft Graph API consists of the v1.0 and beta endpoints. Note the following about the endpoint pattern.
24+
25+
- `version` specifies the `v1.0` or `beta` API.
26+
- `resource` specifies the resource your add-in interacts with, such as a user, group, or site.
27+
- `query_parameters` specifies parameters to customize your request. For example, you can filter the messages returned to only those from a specific sender.
28+
29+
```http
30+
https://graph.microsoft.com/[version]/[resource]?[query_parameters]
31+
```
32+
33+
For more information on the Microsoft Graph API and its components, see [Use the Microsoft Graph API](/graph/use-the-api).
34+
35+
## See also
36+
37+
- [Microsoft Graph REST API v1.0 endpoint reference](/graph/api/overview)
38+
- [Outlook mail API overview](/graph/outlook-mail-concept-overview)
39+
- [Use the Outlook mail REST API](/graph/api/resources/mail-api-overview)
40+
- [Enable SSO in an Office Add-in using nested app authentication (preview)](../develop/enable-nested-app-authentication-in-your-add-in.md)

docs/outlook/use-rest-api.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use the Outlook REST APIs from an Outlook add-in
33
description: Learn how to use the Outlook REST APIs from an Outlook add-in to get an access token.
4-
ms.date: 02/12/2024
4+
ms.date: 04/22/2025
55
ms.topic: how-to
66
ms.localizationpriority: medium
77
---
@@ -11,14 +11,16 @@ ms.localizationpriority: medium
1111
The [Office.context.mailbox.item](/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item) namespace provides access to many of the common fields of messages and appointments. However, in some scenarios an add-in may need to access data that isn't exposed by the namespace. For example, the add-in may rely on custom properties set by an outside app, or it needs to search the user's mailbox for messages from the same sender. In these scenarios, the [Outlook REST APIs](/outlook/rest) is the recommended method to retrieve the information.
1212

1313
> [!IMPORTANT]
14-
> **Outlook REST v2.0 and beta endpoints deprecation**
14+
> **Outlook REST v2.0 and beta endpoints are deprecated**
1515
>
16-
> The Outlook REST v2.0 and beta endpoints will be [fully deprecated on March 31, 2024](https://devblogs.microsoft.com/microsoft365dev/outlook-rest-api-v2-0-and-beta-endpoints-decommissioning-update/). However, privately released and AppSource-hosted add-ins are able to use the REST service until [extended support ends for Outlook 2019 on October 14, 2025](/lifecycle/end-of-support/end-of-support-2025). Traffic from these add-ins is automatically identified for exemption. This exemption also applies to new add-ins developed after the decommission date.
16+
> The Outlook REST v2.0 and beta endpoints are now [deprecated](https://devblogs.microsoft.com/microsoft365dev/final-reminder-outlook-rest-api-v2-0-and-beta-endpoints-decommissioning/). However, privately released and AppSource-hosted add-ins are still able to use the REST service until [extended support ends for Outlook 2019 on October 14, 2025](/lifecycle/end-of-support/end-of-support-2025). Traffic from these add-ins is automatically identified for exemption. This exemption also applies to new add-ins developed after March 31, 2024.
1717
>
18-
> Although add-ins are able to use the REST service until 2025, we highly encourage you to migrate your add-ins to use [Microsoft Graph](/outlook/rest#outlook-rest-api-via-microsoft-graph). For guidance, see [Compare Microsoft Graph and Outlook REST API endpoints](/outlook/rest/compare-graph).
18+
> Although add-ins are able to use the REST service until October 2025, we highly encourage you to migrate your add-ins to use [Microsoft Graph](microsoft-graph.md).
1919
2020
## Get an access token
2121

22+
[!INCLUDE [legacy-exchange-token-deprecation](../includes/legacy-exchange-token-deprecation.md)]
23+
2224
The Outlook REST APIs require a bearer token in the `Authorization` header. Typically apps use OAuth2 flows to retrieve a token. However, add-ins can retrieve a token without implementing OAuth2 by using the new [Office.context.mailbox.getCallbackTokenAsync](/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox#methods) method introduced in the Mailbox requirement set 1.5.
2325

2426
By setting the `isRest` option to `true`, you can request a token compatible with the REST APIs.
@@ -117,5 +119,5 @@ function getCurrentItem(accessToken) {
117119

118120
## See also
119121

120-
- For an example that calls the REST APIs from an Outlook add-in, see [command-demo](https://github.com/OfficeDev/outlook-add-in-command-demo) on GitHub.
121-
- Outlook REST APIs are also available through the Microsoft Graph endpoint but there are some key differences, including how your add-in gets an access token. For more information, see [Outlook REST API via Microsoft Graph](/outlook/rest/index#outlook-rest-api-via-microsoft-graph).
122+
- [Add-in Command sample](https://github.com/OfficeDev/outlook-add-in-command-demo)
123+
- [Use the Microsoft Graph REST API from an Outlook add-in](microsoft-graph.md)

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,8 @@ items:
780780
href: outlook/extension-module-outlook-add-ins.md
781781
- name: On-send add-ins
782782
href: outlook/outlook-on-send-addins.md
783+
- name: Call the Microsoft Graph API
784+
href: outlook/microsoft-graph.md
783785
- name: Call Outlook REST APIs
784786
href: outlook/use-rest-api.md
785787
- name: Call Exchange web services

0 commit comments

Comments
 (0)