Skip to content

Client Role Services

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

Add Client Role (For Super Users only; allowed to add any Role)

Method: POST

URL: http://localhost:3000/rs/clientRoleSuper/add

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2WithSuperUser
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)

Request Body Example:

{
   "role":"tester2",
   "clientId":616   
}

Response:

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

Add Client Role (prohibited from adding some Roles)

Method: POST

URL: http://localhost:3000/rs/clientRole/add

Request headers Example:

Content-Type = application/json
Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)

Request Body Example:

{
   "role":"tester2",
   "clientId":616   
}

Response:

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

Get Client Role List by Client

Method: GET

URL: http://localhost:3000/rs/clientRole/list/510

510 = clientId

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)


Response:

[
    {
        "id": 128,
        "role": "superAdmin",
        "clientId": 510
    },
    {
        "id": 129,
        "role": "admin",
        "clientId": 510
    },
    {
        "id": 130,
        "role": "user",
        "clientId": 510
    }
]

Delete Client Role

Method: DELETE

URL: http://localhost:3000/rs/clientRole/delete/128

128 = id

Request headers Example:

Authorization = bearer jwttokenFromGoAuth2
clientId = 10
userId = tester (when using Auth code, Implicit, or Password tokens)

Response:

{
    "success": true
}