cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crirojsab
Helper I
Helper I

Sharepoint error - Access Denied

Hello I'm trying to create a flow and the idea as that every time someone enter specific information in a sharepoint list this allows the option add users in specific groups in sharepoint (Image Below). However everytime that is executed get the next error: 

 

Access denied. You do not have permission to perform this action or access this resource.
clientRequestId: 195fa1a2-8769-4213-b29f-43c20d1ab1e2
serviceRequestId: 8efcc49f-105f-b000-fc46-6b4f11ad1c8b

 

crirojsab_0-1620236217605.png

The user that execute and add data in the list is an admin of the sharepoint site and also the owner of the job.

 

Any idea of why this job is failing? 

 

Thanks and regards

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
jinivthakkar
Super User
Super User

@crirojsab I just tried this and it worked fine for me, give it a try

jinivthakkar_0-1620402341742.png

 

jinivthakkar_1-1620402394919.png

22 is groupId as highlighted in image 2 and passed in image 1 uri - _api/web/sitegroups(22)/users

 

accept - application/json;odata.metadata=none

content-type - application/json

 

Body - {'LoginName':'i:0#.f|membership|YourEmailIDHERE'}

 

Reference - https://emadgabriel.com/2019/01/04/microsoft-flow-add-user-to-sharepoint-group/

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

jinivthakkar
Super User
Super User

@crirojsab you might be hitting a wrong end point hence you are getting the access denied error.

View solution in original post

3 REPLIES 3
jinivthakkar
Super User
Super User

@crirojsab I just tried this and it worked fine for me, give it a try

jinivthakkar_0-1620402341742.png

 

jinivthakkar_1-1620402394919.png

22 is groupId as highlighted in image 2 and passed in image 1 uri - _api/web/sitegroups(22)/users

 

accept - application/json;odata.metadata=none

content-type - application/json

 

Body - {'LoginName':'i:0#.f|membership|YourEmailIDHERE'}

 

Reference - https://emadgabriel.com/2019/01/04/microsoft-flow-add-user-to-sharepoint-group/

--------------------------------------------------------------------------------

If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

jinivthakkar
Super User
Super User

@crirojsab you might be hitting a wrong end point hence you are getting the access denied error.

crirojsab
Helper I
Helper I

Hi @jinivthakkar you have right as just did what you suggest expecting a different result but was the same; and if works for you should be the same here. Now I'm completely sure that something happened. Now I'm going to contact my IT department. 

Regards!. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,333)