Skip to main content

The UserService service exposes the following operations:

  • create: to create a user
  • get: to retrieve a user
  • update: to modify a user
  • password: to change a user's password
  • search: to search for users
  • delete: to delete a user

Creation et modification d'un user

Model

The model used by create and update calls looks like this:

{
"id": "string",
"firstname": "string",
"lastname": "string",
"displayName": "string",
"mail": "string",
"password": "string",
"credentialsExpired": true,
"attributes": [
{
"name": "string",
"values": [
"string"
]
}
],
"groups": [
"string"
],
"profiles": [
"string"
]
}

Here is the description associated with the call data set:

  • id: unique user identifier
  • firstname, lastname, displayName and mail: user information
  • password: password
  • profiles and groups: respective lists of user profiles and groups to which this user belongs
  • attributes: list of additional attributes
  • credentialsExpired: if the user's credentials have expired.

Example

The examples below show how to create and modify a user.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
curl -X POST "<CORE_HOST>/rest/users/" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"id": "example",
"firstname": "Firstname",
"lastname": "Name",
"displayName": "Firstname name",
"mail": "example@gmail.com",
"password": "password",
"credentialsExpired": false,
"attributes": [
],
"groups": [
],
"profiles": [
"AllUsers", "eEnvelope"
]
}'

Recovery of one or more users

Model

The parameters to be entered are :

NameDescription
idsUnique identifiers of users to be tracked (separated by commas)
resolveAuthoritiesDetermines whether profiles and groups are to be remounted

Example

The example below shows how to retrieve users.

# <CORE_HOST>             FlowerDocs Core base URL
# <TOKEN> authentication token
# <USER_IDS> user IDs to be retrieved
# <RESOLVE_AUTHORITIES> whether to resolve authorities (true/false)
curl -X GET "<CORE_HOST>/rest/users/<USER_IDS>?resolveAuthorities=<RESOLVE_AUTHORITIES>" \
-H "token: <TOKEN>"

Search for one or more user(s)

Model

The parameter to be entered is search, and corresponds to the searched value. The search can be based on the user's surname, first name, the name to be displayed (displayName) or the user's ID, either fully or partially filled in.

Example

The examples below show how to create and modify a user.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <NAME> user name
curl -X GET "<CORE_HOST>/rest/users/search?name=<NAME>" \
-H "token: <TOKEN>"

Changing a user's password

Model

The parameters to be entered are :

NameDescription
idThe user's unique identifier
newPasswordThe user's new password

Example

The example below shows how to change a user's password.

# <CORE_HOST>      FlowerDocs Core base URL
# <TOKEN> authentication token
# <USER_ID> user identifier
# <NEW_PASSWORD> the user's new password
curl -X PUT "<CORE_HOST>/rest/users/<USER_ID>/password" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"password": "<NEW_PASSWORD>"}'

Delete a user

Model

The parameter to be entered is id, the unique identifier of the user to be deleted.

Example

The example below shows how to delete a user.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <USER_ID> user identifier
curl -X DELETE "<CORE_HOST>/rest/users/<USER_ID>" \
-H "token: <TOKEN>"