Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Create a new

...

user

...

in Zephyr Enterprise

...

POST /flex/services/rest/latest/user

Request format

To create a user, send a POST request to the following URL:

httphttp(s)://{ZEPHYR-SERVER}/flex/services/rest/latest/user

Request body

Create a user without a role:

Code Block
languagejson
#Create a user whithout a role

{
  "firstName": "John",
  "lastName": "Smith",
  "email": "John.Smith@smartbear.com",
  "username": "John.Smith",
  "accountEnabled": true,
  "credentialsExpired": false,
  "isCustomizeUsername": null
}

Create a user with a role:

Code Block
languagejson
#Create a user with a role

{
  "firstName": "John",
  "lastName": "Smith",
  "email": "John.Smith@smartbear.com",
  "username": "John.Smith",
  "accountEnabled": true,
  "credentialsExpired": false,
  "isCustomizeUsername": null,
  "roles": [
           {{ "id":5, "name":"dashboard" },
           {{ "id":106, "name":"Administration Role" "}
       
  ]
}

Response body

Code Block
languagejson
{
  "id": 11,
  "username": "John.Smith",
  "firstName": "John",
  "lastName": "Smith",
  "email": "John.Smith@smartbear.com",
  "accountEnabled": true,
  "accountExpired": false,
  "credentialsExpired": false,
  "roles": [],
  "userType": 0,
  "chargeableFlag": true,
  "onlyLoggedInUser": false,
  "groupSet": [],
  "countAttempts": 0,
  "isInternal": true,
  "fullName": "John Smith"
}

Assign a role to the user (or update data of an existing user).

Use the following operation to assign the role to the user:

PUT PUT http(s)://{ZEPHYR-SERVER}/flex/services/rest/v3/user/{user ID}

where {user ID}- is the ID of the Zephyr Enterprise user.

Request format

To assign the role to the user, send a PUT request to the following URL:

http://{ZEPHYR-SERVER}/flex/services/rest/v3/user/{user ID}

Request body

Code Block
languagejson
{
  "firstName":"John",
  "lastName":"Smith",
  "type":"",
  "roles":[
          {"id":5,"name":"dashboard"},
          {"id":106,"name":"Administration Role "}
        ],
  "email":"John.Smith@abc.com",
  "username":"John.Smith",
  "accountEnabled":true,
  "credentialsExpired":true,
  "id":10,
  "isCustomizeUsername":null,
  "userType":0,
  "chargeableFlag":true,
  "groupSet":[]
}

...