Page tree
Skip to end of metadata
Go to start of metadata

Experitest allows Cloud and Project Admins to manage users using Rest API. This page describes supported RestAPI'sfor managing users.

The role of the user performing the Rest Operation is specified by the Authorization header.

For more information please visit How To Execute Rest API, for a detailed example.

Gets all the Users

Gets all the users.

  • This API can only be used by Cloud Admin or Project Admin.
  • Project Admin will get all the users in his project.
  • Cloud Admin will get all the users from all projects.
GET  /api/v1/users
Get Users Response
Response: Status 200 OK
{
    "status": "SUCCESS",
    "data": [
        {
            "id": 1,
            "userName": "admin",
            "firstName": "admin",
            "lastName": "admin",
            "email": "onlinecloud@experitest.com",
            "created": 0,
            "role": "Admin",
            "authenticationType": "BASIC",
            "lastAuthentication": "2019-12-23T10:20:57.291Z"
        },



Creates a new user

Creates a new user in the cloud, required Project Admin or Cloud Admin permission.

  • This API can only be used by Cloud Admin or Project Admin.
POST  /api/v1/users/new


Parameters

Name

Type

Mandatory

Description

usernameStringYesIdentifier of the user
firstNameStringYesFirst name of the user
lastNameStringYesLast name of the user
emailStringYesEmail of the user
projectIntegerNo

Project id to add this user to

If the parameter is not provided then the user will be added to the Default project.

Note: Cloud Admin can only be added to the Default project.


roleStringYes
  • Admin (required Cloud Admin permission)
  • ProjectAdmin
  • User


passwordStringNo

The password must be between 7-25 characters, at least one uppercase letter,

at least one lowercase letter, and at least one digit. The password must contain only valid

characters (a-z,A-Z,0-9,_,-,.,@,#,*,$,!,?,%,~,SPACE). The password must not contain leading or trailing spaces.

Only Admin role can use this option, the blank password will do the same process of generating a random password.

authenticationTypeStringNoAuthentication type for user to log in.
  • BASIC
  • SSO
If the parameter is not provided then authentication type will be BASIC.


Create User Response
{"status":"SUCCESS","data":{"notification":"\u003cp\u003eThe temporary password of the user is: \u003cb\u003eF2rhzN8\u003c/b\u003e\u003c/p\u003e\u003cp\u003ePlease provide this temporary password to the user \u003cb\u003etestqa\u003c/b\u003e by a secured way.\u003cbr/\u003eThe user should login with this password and change it.\u003c/p\u003e\u003cp\u003eThe temporary password is valid for the next 100 years.\u003c/p\u003e","id":"2263818","tempPassword":"F2rhzN8","users":"User added successfully"},"code":"OK"}


Deleting a user

Deletes a user in the cloud, required Project Admin or Cloud Admin permission.

  • This API can only be used by Cloud Admin or Project Admin
POST  /api/v1/users/{userid}/delete

{userid} - userid of the user

Note: userid can be retrieved using Get users Rest API.

Deleting User Response
Response: Status 200 OK
{"status":"SUCCESS","data":{"users":"User deleted successfully"},"code":"OK"}

Getting User Account Info

Get User account info. The response contains Username, First Name, Last Name, Role and Project Details

  • This API can be used by all Users

GET  /api/v1/users/my-account-info

This API can be accessed by Username/Password or Access key. If Username/Password is used to access the API, and the user has more than one project assigned, then the projectName header must be supplied with the request, else the API will return an error.

The API response is as below

my-account-info Response
Response: Status 200 OK

{
  "status": "SUCCESS",
  "data": {
    "username": "john_doe",
    "firstName": "john",
    "lastName": "doe",
    "role": "User",
    "project": {
      "id": 5992,
      "name": "demoProject",
      "created": 1589198952204,
      "notes": null
    }
  },
  "code": "OK"
}










  • No labels