Get a User's Groups

Gets the groups of a user by id and includes all users that share a group with the given user.

Method

GET /identity/groups

Parameters

Query Parameters

Name Description
userId The id of the user to get the groups for.

Result

A JSON object containing groups, the number of members and other users. Its properties are as follows:

Name Value Description
groups Array A JSON array of group object. Every group object has a id property and a name property.
groupUsers Array A JSON array that contains all users that are member in one of the groups.
Every user object has four properties: id, firstName, lastName and displayName. The displayName is the id, if firstName and lastName are null and firstName lastName otherwise.

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json If the userId query parameter is missing. See the Introduction for the error response format.

Example

Request

GET /identity/groups?userId=aUserId

Response

{"groups":
  [{"id":"group1Id",
   "name":"group1"}],
"groupUsers":
  [{"firstName":"firstName",
   "lastName":"lastName",
   "displayName":"firstName lastName",
   "id":"anotherUserId"}]}

目录: