Get list of roles
Updated date: 30/04/2023
Updated by: VNPT eContract's team
Purpose
Function to retrieve the list of roles of a user in the current company
- Request URL:
/api/roles
- HTTP method:
GET
- Authorize:
Bearer token
- Parameter: Not required, but additional options can be added below to filter or search the list of user roles.
Key | Type | Description |
---|---|---|
search | string | Search information by role code or role name |
page | int | Page number (default is 1) |
pagesize | int | Page size (default is 10 records) |
Sample request
Query param:
page: 1
pageSize:10
search: Default
Request: /api/roles?page=1&pageSize=10&search=Default
Sample response body
{
"data": {
"items": [
{
"id": "2b999cd0-32ec-4e4a-16b8-08da6df5fc5a",
"code": "Default",
"name": "Mặc định",
"description": "Vai trò mặc định với những quyền cơ bản"
}
],
"totalCount": 1,
"pageCount": 1,
"page": 1,
"pageSize": 10,
"hasNextPage": false,
"hasPreviousPage": false
},
"success": true,
"code": 0,
"messages": []
}