Graph API 401 Unauthorized error

svc_CLM_CampOps_Custom_EPS_WW 1 Reputation point
2022-09-09T23:12:44.68+00:00

I am attempting to call POST https://graph.microsoft.com/v1.0/planner/plans

I have a valid access_token response from the authorization API which I use in the call as 'Bearer <access_token>. I have checked my application permisions and they include Group.ReadWrite.All and Tasks.ReadWrite. I have verified that my JSON is valid through the graph explorer.

I cannot figure out why I continue to 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.

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

3 answers

Sort by: Most helpful
  1. HarmeetSingh7172 4,826 Reputation points
    2022-09-09T23:48:21.517+00:00

    Hi @svc_CLM_CampOps_Custom_EPS_WW

    As per the documentation, Create Plannerplan Graph API only supports Delegated permissions.

    Please make sure that you give Tasks.ReadWrite and Group.ReadWrite.All permissions as Delegated permissions while creating a new Plannerplan.

    Post giving permissions, you can decode your application token and check whether 'scp' property has these permissions or not.

    Hope this helps.

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

    0 comments No comments

  2. svc_CLM_CampOps_Custom_EPS_WW 1 Reputation point
    2022-09-10T16:16:55.697+00:00

    Thank you for your response. I do have delegated permissions:

    239781-image.png

    I have tried to decode my toked, but it is showing completely different roles than what I have configured:

    239763-image.png


  3. svc_CLM_CampOps_Custom_EPS_WW 1 Reputation point
    2022-09-12T23:35:42.9+00:00

    I don't know the difference...can you provide any detail with how to get a delegated token?


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.