返回介绍

15.15. Groups

发布于 2023-09-17 23:40:35 字数 7715 浏览 0 评论 0 收藏 0

15.15.1. Get a single group

GET identity/groups/{groupId}
Table 258. Get a single group - URL parameters
ParameterRequiredValueDescription
groupIdYesStringThe id of the group to get.

Success response body:

{
   "id":"testgroup",
   "url":"http://localhost:8182/identity/groups/testgroup",
   "name":"Test group",
   "type":"Test type"
}
Table 259. Get a single group - Response codes
Response codeDescription
200Indicates the group exists and is returned.
404Indicates the requested group does not exist.

15.15.2. Get a list of groups

GET identity/groups
Table 260. Get a list of groups - URL query parameters
ParameterDescriptionType
idOnly return group with the given idString
nameOnly return groups with the given nameString
typeOnly return groups with the given typeString
nameLikeOnly return groups with a name like the given value. Use % as wildcard-character.String
memberOnly return groups which have a member with the given username.String
potentialStarterOnly return groups which members are potential starters for a process-definition with the given id.String
sortField to sort results on, should be one of id, name or type.String

Success response body:

{
   "data":[
   {
    "id":"testgroup",
    "url":"http://localhost:8182/identity/groups/testgroup",
    "name":"Test group",
    "type":"Test type"
   }
   ],
   "total":3,
   "start":0,
   "sort":"id",
   "order":"asc",
   "size":3
}
Table 261. Get a list of groups - Response codes
Response codeDescription
200Indicates the requested groups were returned.

15.15.3. Update a group

PUT identity/groups/{groupId}

Body JSON:

{
   "name":"Test group",
   "type":"Test type"
}

All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only updating the name of the group, leaving all other fields unaffected. When an attribute is explicitly included and is set to null, the group-value will be updated to null.

Table 262. Update a group - Response codes
Response codeDescription
200Indicates the group was updated.
404Indicates the requested group was not found.
409Indicates the requested group was updated simultaneously.

Success response body: see response for identity/groups/{groupId}.

15.15.4. Create a group

POST identity/groups

Body JSON:

{
   "id":"testgroup",
   "name":"Test group",
   "type":"Test type"
}
Table 263. Create a group - Response codes
Response codeDescription
201Indicates the group was created.
400Indicates the id of the group was missing.

Success response body: see response for identity/groups/{groupId}.

15.15.5. Delete a group

DELETE identity/groups/{groupId}
Table 264. Delete a group - URL parameters
ParameterRequiredValueDescription
groupIdYesStringThe id of the group to delete.
Table 265. Delete a group - Response codes
Response codeDescription
204Indicates the group was found and has been deleted. Response-body is intentionally empty.
404Indicates the requested group was not found.

15.15.6. Get members in a group

There is no GET allowed on identity/groups/members. Use the identity/users?memberOfGroup=sales URL to get all users that are part of a particular group.

15.15.7. Add a member to a group

POST identity/groups/{groupId}/members
Table 266. Add a member to a group - URL parameters
ParameterRequiredValueDescription
groupIdYesStringThe id of the group to add a member to.

Body JSON:

{
   "userId":"kermit"
}
Table 267. Add a member to a group - Response codes
Response codeDescription
201Indicates the group was found and the member has been added.
404Indicates the userId was not included in the request body.
404Indicates the requested group was not found.
409Indicates the requested user is already a member of the group.

Response Body:

{
   "userId":"kermit",
   "groupId":"sales",
  "url":"http://localhost:8182/identity/groups/sales/members/kermit"
}

15.15.8. Delete a member from a group

DELETE identity/groups/{groupId}/members/{userId}
Table 268. Delete a member from a group - URL parameters
ParameterRequiredValueDescription
groupIdYesStringThe id of the group to remove a member from.
userIdYesStringThe id of the user to remove.
Table 269. Delete a member from a group - Response codes
Response codeDescription
204Indicates the group was found and the member has been deleted. The response body is left empty intentionally.
404Indicates the requested group was not found or that the user is not a member of the group. The status description contains additional information about the error.

Response Body:

{
   "userId":"kermit",
   "groupId":"sales",
  "url":"http://localhost:8182/identity/groups/sales/members/kermit"
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文