How To Get Outlook Tasks Using Microsoft Graph

This blog shows how to use the Outlook Tasks API to get tasks from Outlook Online in Microsoft Graph Explorer.

Microsoft Graph is a unified API to access all services and data across Microsoft 365. In this blog, we will learn how to retrieve Outlook tasks using Microsoft Graph Explorer.

Accessing Outlook tasks is available in beta version for now but in the future, it may get moved to the public version v1.0.

Follow the below steps to get the available tasks for the current user,

  • Navigate to Microsoft Graph Explorer using the URL - https://developer.microsoft.com/en-us/graph/graph-explorer/
  • Then, sign into the explorer using any of your Microsoft accounts. 
  • Select the HTTP method as GET and then, select beta as the API version.
  • Enter the below URL in the Graph Request URL box - https://graph.microsoft.com/beta/me/outlook/tasks
  • And, click the "Run Query" button.

To get the Outlook tasks based on the specified users, use the below endpoint.

https://graph.microsoft.com/beta/users/< id | UserPrincipalName >/outlook/tasks

We must give the user’s id or principal name in the URL next to users/ in Microsoft Graph endpoint.

To get a single Outlook task, add the task id in the URL and run that in Microsoft Graph Explorer. 

https://graph.microsoft.com/beta/users/< id | UserPrincipalName >/outlook/tasks/<task id>

How To Get Outlook Tasks Using Microsoft Graph 

By default, the times specified in tasks are returned in UTC format. To get the date time values in our time zone format, we have to specify the time zone value in the header request along with the URL sent in Graph Explorer.

To get the Outlook tasks with your time zone, you should add prefer:outlook-timezone=”<timezone>” in the Request header.

For example, to get the time based on the Indian Time zone, we use the below Request header.

Prefer: outlook-timezone=”India Standard Time”

How To Get Outlook Tasks Using Microsoft Graph 

Conclusion

The outlook/tasks endpoint helps to work with Outlook tasks. By using GET method, we can fetch task details from Outlook.