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

View solution in original post

@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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,213)