403 You do not have permission to view this directory or page using the credentials that you supplied on get tasks

Helker Suardi 21 Reputation points
2022-11-29T16:25:23.02+00:00

I am trying to get the tasks

Login
POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
{
client_id,
scope: https://graph.microsoft.com/.default,
grant_type: client_credentials,
client_secret
}

Request
GET https://graph.microsoft.com/v1.0/planner/tasks

Permissions
265280-captura-de-tela-de-2022-11-29-13-22-59.png

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,479 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 94,366 Reputation points MVP
    2022-11-29T18:35:04.327+00:00

    You are obtaining a token in the application context, i.e. running without a user context. This is not currently supported for Planner. Refer to the official documentation for more details: https://learn.microsoft.com/en-us/graph/api/planneruser-list-tasks?view=graph-rest-beta&tabs=http
    A preview of this should be coming by end of year though: https://devblogs.microsoft.com/microsoft365dev/announcing-updates-to-the-planner-api-in-microsoft-graph/

    Lastly, you need to specify the user for which to retrieve tasks for, or use the /me shortcut. But again, only for delegate permissions.

    0 comments No comments

0 additional answers

Sort by: Most helpful