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

Customizing SharePoint list and implementing Quick search using jQuery

Enable and Disable Client side People Picker using jQuery

How to generate PDF using jsPDF and html2canvas library