-1

When using Office 365 APIs to access only email items, should I use the Graph API or Outlook API? I don't need all the different services that the Graph API provides, but the Outlook API seems more full-featured. Which one is more future-proof?

JKoning
  • 285
  • 1
  • 2
  • 8

2 Answers2

2

I would actually suggest using the Graph API if it has the features that you need, simply because the fact that you do not need anything outside of Outlook now, you might in the near future seeing as different Office 365 features are starting to get more and more integrated with each other. Next to that, I personally think it is better documented and overall nicer to work with. As an added benefit, if you'd ever develop another O365 related integration you already know how it works, as all services in the Microsoft Graph use more or less the same structures.

If you're after the most widely supported solution try the EWS API as most Exchange servers (even those not in O365) will have it enabled and Outlook gives you a token and details for that as well. It is not the most future proof however.

Jessevl
  • 909
  • 1
  • 6
  • 4
1

It depends on the context in which your code is running. If your code is executing in the context of a Mail Add-In and will not need access to any of the other Graph resources then just the Outlook APIs should be a good bet, also they will not need any further authentication or consent steps.

If you might want to access OD4B or O365 Groups from within the code accessing the mail then using the Graph API would make sense.

There are a couple of things to note on this front though.

  1. The Id for an email on the Outlook API is not exactly the same as it is on the Graph. https://blog.mastykarz.nl/office-365-unified-api-mail/
  2. When using the Graph if you want to expand the permissions consented to on your AAD Application you'll have to jump through some hoops in the code to trigger a re-consent under the v1 AAD Application Model

Finally, new APIs will likely land in the Outlook (or other product) specific APIs first and then get ported into the Graph API

GavinB
  • 515
  • 5
  • 15