TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
parthasarathy B
NA
927
107k
User not removing from group using Sharepoint rest API
Oct 9 2018 3:49 AM
Hi all,
I am trying remove user from Sharepoint group using Rest API.I have tried the below code but it is not getting any error but the user is not removing from the group.Please help me to find out what i am doing wrong in the code.Thanks in advance.
principal ID is the ID of the user and roledefid is the id of the sharepoint contribute group
function revokePermission(webURL,listTitle,userID)
{
debugger;
try
{
var roleID=1073741827;
jQuery.ajax({
url: webURL +
"/_api/Web/roleassignments/removeroleassignment(principalid="
+userID+
",roledefid="
+roleID+
")"
,
method:
"POST"
,
headers: {
"Accept"
:
"application/json;odata=verbose"
,
"X-RequestDigest"
: $(
"#__REQUESTDIGEST"
).val(),
'X-HTTP-Method'
:
'DELETE'
},
success: function (data) {
debugger;
//var userGroups= data.d.Member;
//userGroups.deleteObject();
},
error: function (data) {
htmlContent+=
""
;
console.log(data);
}
});
}
catch
(e) {
console.log(e);
}
}
Reply
Answers (
8
)
send email using workflow
SharePoint Online Infopath Issues ?