Retrieving To-Do Tasks with a Single Graph API Call

Hadi Mahmood 0 Reputation points
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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,088 questions
Microsoft Power Platform Training
Microsoft Power Platform Training
Microsoft Power Platform: An integrated set of Microsoft business intelligence services.Training: Instruction to develop new skills.
580 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 10,015 Reputation points Microsoft Vendor
    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.


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.