cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zhangzhonghao
Helper II
Helper II

Flow failed when calling createPlan graph API

I want to create a plan of Microsoft Planner through calling graph api in an HTTP action. I followed the graph api example https://docs.microsoft.com/en-us/graph/api/planner-post-plans?view=graph-rest-1.0&tabs=http#request , it worked in Graph Explorer but failed in Flow. I've granted the required delegated permission in my Azure AD App, but it still said something about Unauthorized. It both failed with v1.0 and beta. Anyone can help me? Here is the whole error:Capture1.PNG

 

My Flow:Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

HI @Zhangzhonghao ,

 

I think you need to change the authentication type on your end in the HTTP request.

image.png

 

After this is done, then attempt to perform the call using the bearer token from the previous action:

 

image.png

 

Hope this helps!

 

Regards,

Ricardo

View solution in original post

6 REPLIES 6
rimatos
Community Support
Community Support

Hi @Zhangzhonghao ,

 

I believe this is due to the permissions, since the Planner REST action does not support application permissions, so you wont be able to authenticate using client ID and secret I believe.

 

image.png

 

Regards,

Ricardo

@rimatos Thanks for your Information! I remembered I have granted the Azure AD App with the required delegated permission, why it doesn't get authenticated? 

  Capture.PNG

@rimatos So is there a way to call this api in flow?

HI @Zhangzhonghao ,

 

I think you need to change the authentication type on your end in the HTTP request.

image.png

 

After this is done, then attempt to perform the call using the bearer token from the previous action:

 

image.png

 

Hope this helps!

 

Regards,

Ricardo

@rimatos  Thanks for your guidance! Currently, I use the "Active Directory OAuth" as my Authentication type. Do you mean that I should select "None" as the type and get the bearer access token, then pass it to the next http request to create plan? Actually, I've tried this way, but the body is different from yours when getting the access token.

Capture.PNG

Another question is how your "Show advanced options" looks like, in other word, how do you authenticate the HTTP request of getting access token. 

 

I'll try this way again with your body sample. Thank you very much for providing this information here!

@rimatos so much grateful for your help! Finally, I got the flow pass following your steps provided here. Thanks again!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,968)