I want to create a flow in Microsoft flow that creates a plan in Microsoft planner each time an item is added to a list in SharePoint. There is no action in Microsoft flow you can use to create a plan so I decided to use the Microsoft Graph Api where it IS possible to create a plan. With a http action I'm able to call the API Before you can call the Microsoft Graph API to create a plan you need to follow a few basic steps:
- Register your app to authenticate with the Azure v2.0 endpoints.
- Configure permissions for Microsoft Graph on your app.
- Get administrator consent.
- Get an access token.
- Use the access token to call Microsoft Graph.
These steps are described into this tutorial: https://developer.microsoft.com/en-us/graph/docs/concepts/auth_v2_service.
The description of how to use the create plan in planner graph API: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/planner_post_plans#example
The problem that i have is that i can't use the access token to call Microsoft Graph. I'm able to perform all steps except step 5 where I need to use the access token to call microsoft graph. Im having a "401" errorcode "unauthorized". I've been searching to solve this problem for 4 days know but I can't seem to solve it. Underneath you can find screenshots of how my flow looks like:
- general view flow
- action where I request acces token
- action where I call Microsoft graph
- Errormessage after calling Microsoft Graph
Thanks in advance!