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

  1. {"groups":
  2. [{"id":"group1Id",
  3. "name":"group1"}],
  4. "groupUsers":
  5. [{"firstName":"firstName",
  6. "lastName":"lastName",
  7. "displayName":"firstName lastName",
  8. "id":"anotherUserId"}]}

原文: https://docs.camunda.org/manual/7.9/reference/rest/identity/get-group-info/