Search code examples
office-jsoutlook-addinoutlook-web-addinsoutlook-restapi

Which API Should I Use to Access Outlook Tasks in a JavaScript-Based Add-In?


Microsoft continuously enhances its products and services, and there are multiple APIs available for interacting with Outlook features. For my specific use case, I need to access Outlook Tasks within a JavaScript-based add-in.

I have come across the following options but am unsure which is the most recommended and future-proof solution:

My Requirement

  • I want to adopt an approach that is aligned with Microsoft's current best practices and is expected to remain supported in the future

Questions

  1. Which API is the most recommended for accessing Outlook Tasks in a JavaScript-based add-in, considering future compatibility and ease of use?
  2. Is Office REST API Version 2.0 still a viable option, or is it considered deprecated in favor of Microsoft Graph?

Solution

  • OfficeJs APIs are the APIs provided for web addins and you should use these whenever possible. If you do not find API for your scenario in OfficeJs APIs you can use other APIs. For these APIs you will need to acquire auth token. You can try using Microsoft Graph APIs as it's most recent. For more details on enabling SSO and acquiring Graph token for addins please check here

    You can also use Office JS API(makeEwsRequestAsync) to make EWS request this would not require you to acquire access token separately. Please refer to doc here for more details