Web Service Method: Create a New User

Description

Creates a new user on a PoolParty server.

Note

This is the equivalent service of using the user interface: Create a New User

You can only create users when the server uses https.

URL: /PoolParty/api/user/addUser

Request

Supported Methods

POST

Content-Type

application/json

Note

This service consumes a JSON object, starting with version 5.5.

Before that, simple strings as http parameterswhere used to ship data to the service.

JSON Request Object

Request object to define a new user.

Attribute

Type

Required

Comment

name

String

true

Unique user name, used for authentication in PoolParty.

Note

You will receive an error message in case the username is already in use.

password

String

true

Password for the user.

The password has to meet the password requirements.

fullname

String

false

Full name of the user. This field is only used for presentation purposes.

Usually, this field consists of first and last name.

groups

Array of Strings

false

List of groups that should be assigned to the user.

roles

Array of Strings

false

List of roles that should be assigned to the user.

See:User Roles in PoolParty

Possible values:

  • ApiAdmin

  • ApiUser

  • PoolPartyAdmin

  • PoolPartyReadOnly

  • PoolPartySuperAdmin

  • PoolPartyUser

  • WikiEditor

uri

URI

false

The URI of the user.

If you do not provide a URI, the used URI will follow this pattern: userBaseURL/username

Note

The URI is treated as unique in PoolParty. When you define a user URI that already exists, the new URI will be modified to guarantee uniqueness.

Response

http status code 200if OK.

Basic Pattern

POST https://<server-url>/PoolParty/api/user/addUser
Content-Type: application/json
{
 "name": "<name_of_user>",
 "password": "<password>",
 "fullname" : "<full_name_of_user>",
 "groups" : [
    "<group>"
 ],
 "roles" : [
    "<role>"
 ],
 "uri" : { 
 "uri": "<uri_of_user>"
 }
}

Example

Usage of a REST Client

The following screenshot shows the creation of a user in PoolParty using Postman:

27901397.png