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.

POST {{core}}/rest/users/ HTTP/1.1

-- URL parameters --
core: FlowerDocs Core host

-- Headers --
token: {{token}}
Content-Type: application/json

-- Body (json) --

"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.

GET {{core}}/rest/users/{ids}?resolveAuthorities={resolveAuthorities} HTTP/1.1

-- URL parameters --
core: hostFlowerDocs Core hosts: user IDs to be retrieved
resolveAuthorities : false

-- Headers --
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.

GET {{core}}/rest/users/search?name={name} HTTP/1.1

-- URL parameters --
core: hostFlowerDocs Core hostme: user name

-- Headers --
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.

PUT {{core}}/rest/users/{id}/password HTTP/1.1

-- URL parameters --
core: hostFlowerDocs Core host-- Headers --
token: {{token}}
id: user identifier

-- Body --

"password": newpassword

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.

DELETE {{core}}/rest/users/{id} HTTP/1.1

-- URL parameters --
core: hostFlowerDocs Core host: user identifier

-- Headers --
token: {{token}}