question

SabbaghJesse-6385 avatar image
0 Votes"
SabbaghJesse-6385 asked CarlZhao-MSFT rolled back

Permissions needed to access plans in Graph API

I have registered an app in the Azure portal and given the following permissions:

ChannelMessage.Read.All
Group.Read.All
Group.ReadWrite.All
IdentityRiskyUser.ReadWrite.All
offline_access
Tasks.Read
Tasks.Read.Shared
Tasks.ReadWrite
Tasks.ReadWrite.Shared
Teamwork.Migrate.All
User.Read

I am attempting to call the following API:

https://graph.microsoft.com/v1.0/planner/plans/U6cu4idEi0W1*/tasks

And I get the response:

401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.

When I get a token using my personal Azure account, it works fine so I know I am calling the right endpoint and passing the correct headers/body. What permissions could I be missing?

microsoft-graph-permissionsmicrosoft-graph-groupsmicrosoft-graph-tasks-plans
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CarlZhao-MSFT avatar image
0 Votes"
CarlZhao-MSFT answered CarlZhao-MSFT rolled back

The 401 error should be caused by you using the client credential flow. The api endpoint currently only supports Tasks.Read delegated permissions, so you need to log in with an Azure AD work account and use the auth code flow to obtain a token.

By the way, the api endpoint does not support personal Microsoft accounts. If your account is an Azure AD account, then it is a work account, so it works fine.

139990-image.png



If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




image.png (33.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Dear @SabbaghJesse-6385 Would you please provide us with an update on the status of your issue?

0 Votes 0 ·