REST - Role
REST-Interface
Get role by id
URL
GET <application-url>/api/role/<roleId>
Path parameter
- roleId
Produces
application/json
application/xml
com.matterial.mtr.api.object.Role
- 200 OK
- 400 BAD_REQUEST
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/role/7
Get roles
URL
GET <application-url>/api/role
Query parameter
-
accountId
id of an account -
entityTypeId
entity-type-id(s) (multiple), i.e.:
&entityTypeId=21&entityTypeId=24
-
count
possible: true, false
default: false
additionally loading count of comments -
orderBy
possible:
id
name
type
default: type
the order by -
orderDir
possible: asc, desc
default: asc
the ordering direction - offset
- limit
Produces
application/json
application/xml
com.matterial.mtr.api.object.ListResult<Role>
- 200 OK
- 500 INTERNAL_SERVER_ERROR
Permission
Login
Sample
GET http://localhost:8080/mtr-backend/api/role?count=true
Create role
URL
POST <application-url>/api/role
Consumes
application/json
application/xml
com.matterial.mtr.api.object.Role
Produces
application/json
application/xml
com.matterial.mtr.api.object.Role (id only)
- 201 CREATED
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_ROLE
Sample
POST http://localhost:8080/mtr-backend/api/role
Update role
URL
PUT <application-url>/api/role/<roleId>
Path parameter
- roleId
Consumes
application/json
application/xml
com.matterial.mtr.api.object.Role
Produces
application/json
application/xml
com.matterial.mtr.api.object.Role (id only)
- 201 CREATED
- 400 BAD_REQUEST
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_ROLE
Sample
PUT http://localhost:8080/mtr-backend/api/role/8
Remove role
URL
DELETE <application-url>/api/role/<roleId>
Path parameter
- roleId
Produces
text/plain
Integer - count of removed
- 200 OK
- 400 BAD_REQUEST
- 404 NOT_FOUND
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_ROLE
Sample
DELETE http://localhost:8080/mtr-backend/api/role/8
Assign role to person
URL
PUT <application-url>/api/role/<roleId>/byaccount/<accountId>
Path parameter
- roleId
- accountId
Produces
application/json
application/xml
List<Person>
- assigned persons
- 202 ACCEPTED
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_ROLE
Sample
PUT http://localhost:8080/mtr-backend/api/role/8/byaccount/5
Assign role to persons
URL
PUT <application-url>/api/role/assign/byaccount
Query parameter
-
roleId
id of a role, multiple possible. i.e.:
?roleId=5&roleId=10&...
-
accountId
id of an account, multiple possible. i.e.:
?accountId=5&accountId=10&...
Produces
application/json
application/xml
List<Person>
- assigned persons
- 202 ACCEPTED
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_ROLE
Sample
PUT http://localhost:8080/mtr-backend/api/role/assign/byaccount?roleId=8&accountId=5
Unassign role from person
URL
DELETE <application-url>/api/role/<roleId>/byaccount/<accountId>
Path parameter
- roleId
- accountId
Produces
application/json
application/xml
List<Person>
- unassigned persons (may be empty)
- 202 ACCEPTED
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_ROLE
Sample
DELETE http://localhost:8080/mtr-backend/api/role/8/byaccount/5
Unassign roles from persons
URL
DELETE <application-url>/api/role/assign/byaccount
Query parameter
-
roleId
id of a role, multiple possible. i.e.:
?roleId=5&roleId=10&...
-
accountId
id of an account, multiple possible. i.e.:
?accountId=5&accountId=10&...
Produces
application/json
application/xml
List<Person>
- unassigned persons (may be empty)
- 202 ACCEPTED
- 500 INTERNAL_SERVER_ERROR
Permission
EDIT_ROLE
Sample
DELETE http://localhost:8080/mtr-backend/api/role/assign/byaccount?roleId=8&accountId=5