返回介绍

15.14. Users

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

15.14.1. Get a single user

GET identity/users/{userId}
Table 236. Get a single user - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to get.

Success response body:

{
   "id":"testuser",
   "firstName":"Fred",
   "lastName":"McDonald",
   "url":"http://localhost:8182/identity/users/testuser",
   "email":"no-reply@flowable.org"
}
Table 237. Get a single user - Response codes
Response codeDescription
200Indicates the user exists and is returned.
404Indicates the requested user does not exist.

15.14.2. Get a list of users

GET identity/users
Table 238. Get a list of users - URL query parameters
ParameterDescriptionType
idOnly return user with the given idString
firstNameOnly return users with the given firstnameString
lastNameOnly return users with the given lastnameString
emailOnly return users with the given emailString
firstNameLikeOnly return users with a firstname like the given value. Use % as wildcard-character.String
lastNameLikeOnly return users with a lastname like the given value. Use % as wildcard-character.String
emailLikeOnly return users with an email like the given value. Use % as wildcard-character.String
memberOfGroupOnly return users which are a member of the given group.String
potentialStarterOnly return users which are potential starters for a process-definition with the given id.String
sortField to sort results on, should be one of id, firstName, lastname or email.String

Success response body:

{
   "data":[
    {
     "id":"anotherUser",
     "firstName":"Tijs",
     "lastName":"Barrez",
     "url":"http://localhost:8182/identity/users/anotherUser",
     "email":"no-reply@flowable.org"
    },
    {
     "id":"kermit",
     "firstName":"Kermit",
     "lastName":"the Frog",
     "url":"http://localhost:8182/identity/users/kermit",
     "email":null
    },
    {
     "id":"testuser",
     "firstName":"Fred",
     "lastName":"McDonald",
     "url":"http://localhost:8182/identity/users/testuser",
     "email":"no-reply@flowable.org"
    }
   ],
   "total":3,
   "start":0,
   "sort":"id",
   "order":"asc",
   "size":3
}
Table 239. Get a list of users - Response codes
Response codeDescription
200Indicates the requested users were returned.

15.14.3. Update a user

PUT identity/users/{userId}

Body JSON:

{
  "firstName":"Tijs",
  "lastName":"Barrez",
  "email":"no-reply@flowable.org",
  "password":"pass123"
}

All request values are optional. For example, you can only include the firstName attribute in the request body JSON-object, only updating the firstName of the user, leaving all other fields unaffected. When an attribute is explicitly included and is set to null, the user-value will be updated to null. Example: {"firstName" : null} will clear the firstName of the user).

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

Success response body: see response for identity/users/{userId}.

15.14.4. Create a user

POST identity/users

Body JSON:

{
  "id":"tijs",
  "firstName":"Tijs",
  "lastName":"Barrez",
  "email":"no-reply@flowable.org",
  "password":"pass123"
}
Table 241. Create a user - Response codes
Response codeDescription
201Indicates the user was created.
400Indicates the id of the user was missing.

Success response body: see response for identity/users/{userId}.

15.14.5. Delete a user

DELETE identity/users/{userId}
Table 242. Delete a user - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to delete.
Table 243. Delete a user - Response codes
Response codeDescription
204Indicates the user was found and has been deleted. Response-body is intentionally empty.
404Indicates the requested user was not found.

15.14.6. Get a user’s picture

GET identity/users/{userId}/picture
Table 244. Get a user’s picture - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to get the picture for.

Response Body:

The response body contains the raw picture data, representing the user’s picture. The Content-type of the response corresponds to the mimeType that was set when creating the picture.

Table 245. Get a user’s picture - Response codes
Response codeDescription
200Indicates the user was found and has a picture, which is returned in the body.
404Indicates the requested user was not found or the user does not have a profile picture. Status-description contains additional information about the error.

15.14.7. Updating a user’s picture

GET identity/users/{userId}/picture
Table 246. Updating a user’s picture - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to get the picture for.

Request body:

The request should be of type multipart/form-data. There should be a single file-part included with the binary value of the picture. On top of that, the following additional form-fields can be present:

  • mimeType: Optional mime-type for the uploaded picture. If omitted, the default of image/jpeg is used as a mime-type for the picture.

Table 247. Updating a user’s picture - Response codes
Response codeDescription
200Indicates the user was found and the picture has been updated. The response-body is left empty intentionally.
404Indicates the requested user was not found.

15.14.8. List a user’s info

PUT identity/users/{userId}/info
Table 248. List a user’s info - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to get the info for.

Response Body:

[
   {
    "key":"key1",
    "url":"http://localhost:8182/identity/users/testuser/info/key1"
   },
   {
    "key":"key2",
    "url":"http://localhost:8182/identity/users/testuser/info/key2"
   }
]
Table 249. List a user’s info - Response codes
Response codeDescription
200Indicates the user was found and list of info (key and url) is returned.
404Indicates the requested user was not found.

15.14.9. Get a user’s info

GET identity/users/{userId}/info/{key}
Table 250. Get a user’s info - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to get the info for.
keyYesStringThe key of the user info to get.

Response Body:

{
   "key":"key1",
   "value":"Value 1",
   "url":"http://localhost:8182/identity/users/testuser/info/key1"
}
Table 251. Get a user’s info - Response codes
Response codeDescription
200Indicates the user was found and the user has info for the given key..
404Indicates the requested user was not found or the user doesn’t have info for the given key. Status description contains additional information about the error.

15.14.10. Update a user’s info

PUT identity/users/{userId}/info/{key}
Table 252. Update a user’s info - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to update the info for.
keyYesStringThe key of the user info to update.

Request Body:

{
   "value":"The updated value"
}

Response Body:

{
   "key":"key1",
   "value":"The updated value",
   "url":"http://localhost:8182/identity/users/testuser/info/key1"
}
Table 253. Update a user’s info - Response codes
Response codeDescription
200Indicates the user was found and the info has been updated.
400Indicates the value was missing from the request body.
404Indicates the requested user was not found or the user doesn’t have info for the given key. Status description contains additional information about the error.

15.14.11. Create a new user’s info entry

POST identity/users/{userId}/info
Table 254. Create a new user’s info entry - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to create the info for.

Request Body:

{
   "key":"key1",
   "value":"The value"
}

Response Body:

{
   "key":"key1",
   "value":"The value",
   "url":"http://localhost:8182/identity/users/testuser/info/key1"
}
Table 255. Create a new user’s info entry - Response codes
Response codeDescription
201Indicates the user was found and the info has been created.
400Indicates the key or value was missing from the request body. Status description contains additional information about the error.
404Indicates the requested user was not found.
409Indicates there is already an info-entry with the given key for the user, update the resource instance (PUT).

15.14.12. Delete a user’s info

DELETE identity/users/{userId}/info/{key}
Table 256. Delete a user’s info - URL parameters
ParameterRequiredValueDescription
userIdYesStringThe id of the user to delete the info for.
keyYesStringThe key of the user info to delete.
Table 257. Delete a user’s info - Response codes
Response codeDescription
204Indicates the user was found and the info for the given key has been deleted. Response body is left empty intentionally.
404Indicates the requested user was not found or the user doesn’t have info for the given key. Status description contains additional information about the error.

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

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

发布评论

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