cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fleur
Level: Powered On

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
v-zhos-msft
Level 10

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
Fleur
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 214 members 5,177 guests
Please welcome our newest community members: