Skip to content

User Admin Services

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

Add User

Method: POST

URL: http://localhost:3001/rs/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,
   "clientId":255
   
}

Response:

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

Update User Info

Method: PUT

URL: http://localhost:3001/rs/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,
   "clientId":255
   
}

Response:

{
   "success": true   
}

Update User Enabled or Disabled

Method: PUT

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

Request headers Example:

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

Request Body Example:

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

Response:

{
   "success": true   
}

Update User Password

Method: PUT

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

Request headers Example:

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

Request Body Example:

{
   "username":"tester1",
   "password":"tester2",  
   "clientId":255   
}

Response:

{
   "success": true   
}

Get User

Method: GET

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

tester1 = user
255 = clientId

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": 255
}

Get All Users

Method: GET

URL: http://localhost:3001/rs/user/list

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

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

Search Users by Client

Method: GET

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

255 = clientId

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

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

Delete User

Method: DELETE

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

tester1 = user
255 = clientId

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10

Response:

{
    "success": true
}