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);
},
  });
}

Comments

Popular posts from this blog

How to Customize exported excel's cell background color in Datatables

Populate dropdown using jquery ajax in SharePoint

Clear DataTable on button click