cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
patryks
Regular Visitor

401 Unauthorized - You do not have permissions to perform action 'run' on scope '/triggers/manual/paths/'

Hello,

 

I am a total beginner in ms flow. My task is to integrate signing application with Sharepoint. I created HTTP triggered flow that receives signed documents and then stores them in Sharepoint.

 

patryks_0-1620718796977.png

 

When I trigger this flow from Postman by executing generated url address then everything works just fine - document is added to Sharepoint. When I execute this url from my application then I receive:

 

 

org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: [{"error":{"code":"AuthorizationFailed","message":"You do not have permissions to perform action 'run' on scope '/triggers/manual/paths/'. Verify you are making the request with the appropriate HTTP method. See http://aka.ms/logic-trigger for details."}}]

 


 I searched the internet and found some similar cases but in none of them, I found relevant explanations or solutions. If you could help me understand:

1. why is it working in postman and not in the application

2. how to fix it?

4 REPLIES 4
annajhaveri
Super User
Super User

@patryks  can you share the code that you are using to do the HTTP request to trigger the flow?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Basically I use restTemplate

 

//url - hardcoded url generated in flow

ResponseEntity<Object> responseEntity = restTemplate.exchange(url, HttpMethod.POST, entity, Object.class);

I do not set any headers except for Content-Type: application/json. The url is interpreted correctly as when I remove parameters sp, sv or api-version then I receive other exception.

@patryks  refer to this post https://knowledge-junction.com/2021/02/12/m365-azure-power-platform-trigger-power-automate-from-net-... it should help you on how to call the http trigger url from code.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Ok. I will try that but at first glance, it seems it is exactly the same way as I did - the only change is that in this link the header is named "content-type" and I use "Content-Type". Will get back to you with the results. Thank you. 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (58,433)