SP.User.groups property (sp.js)
Gets the collection of groups of which the user is a member.
Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013
var value = SP.User.get_groups ()
Return value
SP.GroupCollection
An SP.GroupCollection object (sp.js) object that represents the groups.
REST resource endpoint
See User resource for more information.
Endpoint URI structure
http://<sitecollection>/<site>/_api/web/sitegroups(groupid)/users(loginname)/groups
HTTP requests
This resource supports the following HTTP commands:
- POST
POST syntax
POST http://<sitecollection>/<site>/_api/web/sitegroups(groupid)/users(loginname)/groups
GET syntax
GET http://<sitecollection>/<site>/_api/web/sitegroups(groupid)/users(loginname)/groups