cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Need help using SharePoint REST API in Flow

My goal is probably a common requirement.  Our HR team have a SharePoint list for Pay Authorisation requests and need the items to have restricted permissions where the Author, Approvers and HR team are the only ones allowed to view the contents.

I'm using the information in a blog by Serge Luca:
https://sergeluca.wordpress.com/2018/05/03/assign-unique-permissions-to-a-document-with-the-new-send...

The first part works just fine:Flow1.png

However I am getting Flow Failed error when I try to set the Author of the document:

 

Flow2.png

The Flow shows the error like this:

FlowUnauth.png

And the detail says:

 

<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
            <br><br>

            <b> Requested URL: </b>/sites/<sitename>/_api/web/lists/getByTitle(&#39;Pay Authorisation&#39;)/items(8211)/roleassignments/addroleassignment(principalid=firstname.lastname@domain.com} ,roledefid=1073741826)<br><br>

 


What I don't understand is that both requests are very similar and post to the same document.  So I don't understand why one works and the other doesn't.  


I'd really appreciate any insights or assistance.

 



 

2 REPLIES 2
Highlighted
Solution Sage
Solution Sage

Re: Need help using SharePoint REST API in Flow

Hi @Fleur ,

Could you please share a full screenshot of your flow's configuration?

As the error message shown, the Http request can't find the resource.

Please make sure you have set the correct value of 'principalid'.

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Advocate II
Advocate II

Re: Need help using SharePoint REST API in Flow

Thank you so much for responding. I was able to work out my error - just a pesky little space at the end of the api code!  Lesson learned. 

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (9,407)