Retrieving To-Do Tasks with a Single Graph API Call

Anonymous
2025-02-12T12:07:37.1+00:00

Hi,

I am currently using PowerAutomate to retrieve all tasks and assigned tasks for users via Graph API calls. So far, I have attempted two methods:

Method 1:

  • To Do Tasks: https://graph.microsoft.com/v1.0/users/{user-email}/todo/lists/tasks
  • Planner Tasks: https://graph.microsoft.com/v1.0/users/{user-email}/planner/tasks

Method 2:

  1. Retrieve all groups:
    GET https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(c:c+eq+'Unified')
  2. Retrieve all plans:
    GET https://graph.microsoft.com/v1.0/planner/plans?$filter=owner eq 'groupId'
    or
    GET https://graph.microsoft.com/v1.0/groups/{groupId}/planner/plans
  3. Retrieve tasks for each plan:
    GET https://graph.microsoft.com/v1.0/planner/tasks?$filter=planId eq '{planId}'

While these methods successfully fetch the required tasks, they involve multiple API calls. I am seeking a more efficient approach that allows me to retrieve all tasks (both assigned and planned) in a single API call, without having to send multiple requests as in the methods outlined above.

Any guidance on this would be greatly appreciated.

Best regards,

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2025-02-13T01:48:58.0166667+00:00

    Hello Hadi Mahmood,

    Thank you for reaching out to Microsoft Support!

    For your problem, we suggest that you can use JSON batching to combine multiple HTTP requests into a single request and retrieve all tasks (both assigned and planned) from a single request.

    POST https://graph.microsoft.com/v1.0/$batch
    Accept: application/json
    Content-Type: application/json
    {
      "requests": [
        {
          "id": "1",
          "method": "GET",
          "url": "/users/{user-email}/todo/lists/tasks"
        },
        {
          "id": "2",
          "method": "GET",
          "url": "/users/{user-email}/planner/tasks"
        }
      ]
    }
    

    For more information about JSON batching please check this document:

    https://learn.microsoft.com/en-us/graph/json-batching

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


  2. Anonymous
    2025-02-24T06:11:56.4233333+00:00

    Thanks for your reply .
    Let me see if it works.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.