7

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

<Sitename>/_api/web/sitegroups/getbyname('Approvers')

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

2 Answers 2

8

If your're working with REST you can apend $select tag to get specific properties. If would look like like this:

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

But even in this case you will get object containing at least __metadata tag, because SharePoint REST services is based on OData web protocol standards specification and works this way.

1
  • 1
    Refer link to see the OData representation of Groups and this link to know how to get specific properties.
    – nbi
    Jul 19, 2015 at 20:20
4

Get all groups of site

_api/web/sitegroups

Get All Users in Site

_api/web/siteusers

Get particular group in site

_api/Web/SiteGroups/GetById(IdOfGroup)

Remove particular user from group

executor.executeAsync({
  url: "<app web url>/_api/web/sitegroups(GroupId)/users/getbyid(UserId)",
  method: "POST",
  headers: { "X-HTTP-Method": "DELETE" },
  success: successEventHandler,
  error: errorEventHandler
 });

Source: Link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.