Skip to content

Client User Services

Ken Williamson edited this page Jan 19, 2020 · 4 revisions

Used to allow Clients to manage their users

Add User

Method: POST

URL: http://localhost:3001/rs/client/user/add

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Request Body Example:

{
   "username":"tester1",
   "password":"tester1",
   "enabled":true,
   "emailAddress":"tester1@tester1.com",
   "firstName":"tester1",
   "lastName":"tester1",
   "roleId":1 
}

Response:

{
   "success": true,
   "id": 34
}

Update User Info

Method: PUT

URL: http://localhost:3001/rs/client/user/update

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Request Body Example:

{
   "username":"tester1",
   "emailAddress":"tester11@tester1.com",
   "firstName":"tester11",
   "lastName":"tester11",
   "roleId":2
}

Response:

{
   "success": true   
}

Update User Enabled or Disabled

Method: PUT

URL: http://localhost:3001/rs/client/user/update

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Request Body Example:

{
   "username":"tester1",   
   "enabled":true 
}

Response:

{
   "success": true   
}

Update User Password

Method: PUT

URL: http://localhost:3001/rs/client/user/update

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Request Body Example:

{
   "username":"tester1",
   "password":"tester2"  

Response:

{
   "success": true   
}

Get User

Method: GET

URL: http://localhost:3001/rs/client/user/get/tester1

tester1 = user

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

{
    "username": "tester1",
    "enabled": true,
    "dateEntered": "2020-01-04T00:00:00Z",
    "emailAddress": "tester1@someDomain.com",
    "firstName": "tester1",
    "lastName": "tester1",
    "roleId": 1,
    "clientId": 10
}

Search Users for Client

Method: GET

URL: http://localhost:3001/rs/client/user/search

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

[
    {
        "username": "tester",
        "enabled": true,
        "firstName": "tester",
        "lastName": "tester",
        "clientId": 10
    },
    {
        "username": "tester1",
        "enabled": true,
        "firstName": "tester111",
        "lastName": "tester111",
        "clientId": 10
    },
    {
        "username": "tester3",
        "enabled": false,
        "firstName": "Tester3",
        "lastName": "Tester3",
        "clientId": 10
    }
]

Delete User

Method: DELETE

URL: http://localhost:3001/rs/client/user/delete/tester1

tester1 = user

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

{
    "success": true
}