Get Group Id Using REST

I want to get group id in single call. I am using below URL

/_api/web/sitegroups/getbyname('Approvers')

it is returning object. I want to apply filter to above url to get group id.

July 19th, 2015 10:29am

Hi Rahul,

You have to use the REST API url like below to get ID,

_api/web/sitegroups/getbyname('Approvers')?$select=id

 var url = "<<siteurl>>/_api/web/sitegroups/getbyname('Approvers')?$select=id";
    $.ajax({
        url: url,
        method: "GET",
        headers: { "Accept": "application/json; odata=verbose" },
        success: function (data) {
                        console.log(data.d.Id);       
                    },
        error: function (data) {
             console.log(data);

        }
    });

Thanks


Free Windows Admin Tool Kit Click here and download it now
July 20th, 2015 2:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics