Outlook REST API与Microsoft Graph [英] Outlook REST API vs Microsoft Graph

查看:109
本文介绍了Outlook REST API与Microsoft Graph的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要从Outlook.com和Office 365检索和编辑日历事件的应用程序.我已经看到有两个选项:

I am working on an application that needs to retrieve and edit calendar events from Outlook.com and Office 365. I have seen there are 2 options:

  1. Outlook REST API
  2. Microsoft Graph

它们似乎具有几乎相同的界面.我看到Outlook REST API支持通知(webhooks),Microsoft graph不支持.那么,选择哪一个,优点/缺点是什么,为什么会有2个api?

They seem to have pretty much the same interface. I saw that Outlook REST API has support for notifications (webhooks), Microsoft graph does not ?. So which one to choose, what are the advantages/disadvantages and why are there 2 api's ?

推荐答案

要从Outlook.com检索和编辑日历事件,可以使用Microsoft Graph API和Outlook REST API端点.如果您要在生产中使用的应用程序需要Webhooks,则需要使用Outlook REST API v2.0终结点.我们已经在Microsoft Graph的预览版中提供了Webhooks,并且正在对其进行GA处理,因此您将来可以在生产应用程序中使用它们.如果您的应用程序不需要Webhooks,则可以使用Microsoft Graph v1.0.完全支持Microsoft Graph和Outlook REST API端点.

To retrieve and edit calendar events from Outlook.com, Microsoft Graph API and Outlook REST API endpoints work. If you require Webhooks for an app you are planning to use in production, then you need to use Outlook REST API v2.0 endpoint. We have Webhooks available in preview on Microsoft Graph, and are working to GA them, so you can use them in your production apps in the future. If you don't need Webhooks for your app, then you can use Microsoft Graph v1.0. Both Microsoft Graph and Outlook REST API endpoints are fully supported.

现在继续说明为什么有2个端点. Outlook REST API v1.0于2014年10月发布,我们在2015年11月提供了改进的v2.0版本.它具有通过API公开的最新最强大的Outlook功能. Microsoft Graph v1.0是我们在2015年11月推出的便捷端点,该应用程序可以从多个Microsoft服务访问信息,例如Outlook,One Drive和Azure Active Directory.实际上,当您向Microsoft Graph v1.0终结点请求任何Outlook功能时,该请求将被路由到幕后的Outlook REST API v2.0终结点.因此,API集在设计上是相同的!

Now on to why there are 2 endpoints. Outlook REST API v1.0 was launched in October 2014, and we offered an improved v2.0 version in November 2015. It has the latest greatest Outlook features exposed through APIs. Microsoft Graph v1.0 is a convenient endpoint, we launched in November 2015, for an app to access information from multiple Microsoft services, for example, Outlook, One Drive, and Azure Active Directory. In fact, when you make a request to Microsoft Graph v1.0 endpoint for any Outlook features, the request gets routed to Outlook REST API v2.0 endpoint under the covers. So the API sets are same by design!

我们正在努力缩小各个服务API端点(Outlook REST API,OneDrive API,AAD Graph API等)与Microsoft Graph之间的差距,但是由于两个原因,会有较小的差异.

We are working hard to close any gaps between individual service API endpoints (Outlook REST APIs, OneDrive APIs, AAD Graph API etc.) and Microsoft Graph, but there will be a small delta for two reasons.

  1. 单个服务可能具有名称相同但含义不同的实体.例如,Outlook和OneDrive都有文件夹",但它们的含义不同.在这种情况下,我们需要合理化Microsoft Graph API架构,以使您清楚通过Microsoft Graph API时正在访问哪个实体.该文件夹在Outlook API v1.0终结点中可用,我们在Outlook API v2.0终结点中将其重命名为MailFolder,并且该文件夹也通过Microsoft Graph API v1.0公开.因此,在通过Microsoft Graph公开相同功能或API之前,您可能总是会看到一段时间在单个服务终结点中公开某些功能或API.
  2. 例如某些水平功能,Webhooks在Microsoft Graph中可用之前,可以在服务端点中的Preview或GA中更早使用.这是由于Microsoft Graph API是与各个服务端点相比较新的端点.随着时间的流逝,这一差距清单有望降为零.

我们建议您使用Microsoft Graph,只要它具有在生产中支持生产应用程序所需的功能/API,或者至少在Preview中具有支持应用程序开发所需的功能/API.这样一来,您将来便可以轻松扩展需要访问多个Microsoft服务的应用程序功能,而无需更改端点.如果需要仅在单个服务端点中可用的功能(在生产(v2.0)中或作为预览版(beta)),则可以使用Outlook REST API等单个服务端点.

Our recommendation is for you to use Microsoft Graph as long as it has the features/APIs you need in production to support your production apps, or at least in Preview to support app development. This makes it easy for you, in the future, to expand your app functionality requiring access to multiple Microsoft services, without changing endpoints. You can use individual service endpoints such as Outlook REST API if you need a feature that is only available in the individual service endpoint, either in production (v2.0) or as preview (beta).

这篇关于Outlook REST API与Microsoft Graph的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆