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

Add contribute permissions to SharePoint Group on List Item via SP REST API

Hi

 

It is required to grant "Contribute" permissions on List Item in the "Item created" trigger using SharePoint REST API, below URI throws Http 400 error.

_api/lists/getByTitle('permissions')/items/(ID)/roleAssignments/addroleassignment(principalId=GroupId, roledefId=1073741827)

can the above requirement be met using Flow via SP REST API? 

 

Help appreciated.

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
RajuGolla
Level: Powered On

Re: Add contribute permissions to SharePoint Group on List Item via SP REST API

My mistake.

 

There is a forward slash in the URI after Item ID, which was the reason for failing. After removing that all is working as expected.

Copied the working URI for info below.

 

_api/lists/getByTitle('permissions')/items(ID)/roleAssignments/addroleassignment(principalId=GroupId, roledefId=1073741827)

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Add contribute permissions to SharePoint Group on List Item via SP REST API

If you are asking if you can set SharePoint permissions via Flow using a REST API call, the answer is yes per Serge Luca.

 

See blog post here

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Community Support Team
Community Support Team

Re: Add contribute permissions to SharePoint Group on List Item via SP REST API

Hi @RajuGolla,

 

As @ScottShearer said, add contribute permissions to SharePoint Group on List Item via SP REST API is supported currently.

 

Please refer to link below to learn set custom permissions on a list by using the REST interface

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/set-custom-permissions-on-a-list-by-using...

 

 

Best regards,

Alice

 

 

RajuGolla
Level: Powered On

Re: Add contribute permissions to SharePoint Group on List Item via SP REST API

My mistake.

 

There is a forward slash in the URI after Item ID, which was the reason for failing. After removing that all is working as expected.

Copied the working URI for info below.

 

_api/lists/getByTitle('permissions')/items(ID)/roleAssignments/addroleassignment(principalId=GroupId, roledefId=1073741827)

View solution in original post

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 (Last 30 Days)
Users online (5,235)