Get users from SharePoint Group using REST api
How to get users from SharePoint Group using REST api
By using below code you can easily get users from a specific SharePoint Group.
function GetUsers(){
$.ajax({
url:_spPageContextInfo.webAbsoluteUrl +"/_api/web/sitegroups/getbyname('GrpName')/users",
type: 'GET',
dataType: 'json',
headers: {
"accept": "application/json;odata=verbose;charset=utf-8"
},
success: function (data) {
Console.log(data);
},
error: function ajaxError(response) {
alert(response.status + ' ' + response.statusText);
},
});
}
By using below code you can easily get users from a specific SharePoint Group.
function GetUsers(){
$.ajax({
url:_spPageContextInfo.webAbsoluteUrl +"/_api/web/sitegroups/getbyname('GrpName')/users",
type: 'GET',
dataType: 'json',
headers: {
"accept": "application/json;odata=verbose;charset=utf-8"
},
success: function (data) {
Console.log(data);
},
error: function ajaxError(response) {
alert(response.status + ' ' + response.statusText);
},
});
}
Comments
Post a Comment