Roles
#
GET RolesGet all roles.
GET ALL | |
---|---|
Method | GET ALL |
URL or EndPoint | /api/v{version}/organizations/{organizationId}/roles |
Headers | Authorization |
Parameters | organizationId, version |
Body | Not Applicable |
The description of the URL parameters is as follows:
URL Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
v{version} | Yes | string | v1 | Shows the version of API |
organizationId | Yes | string($uuid) | v1 | The identifier for the organization |
organizations | Yes | string | v1 | Directs to the organizations |
roles | Yes | string | v1 | Directs to the roles |
The description of the parameters is as follows:
Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
Version | Yes | string | v1 | Shows the version of API |
organizationId | Yes | string($uuid) | v1 | The identifier for the organization |
#
Request BodyThe request does not have a request body.
#
ResponsesIf the action is successful, the service sends back an HTTP 200 response.
The following data is returned in json format by the service.
{ "success": true, "errors": [ "string" ], "messages": [ "string" ], "result": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "description": "string", "isDefault": true, "permissionCount": 0 } ], "resultInfo": { "totalCount": 0, "pageIndex": 0, "pageSize": 0, "totalPages": 0, "hasNextPage": true, "hasPreviousPage": true }}
Field Name | Type | Example | Description |
---|---|---|---|
success | bool | true | If response is success will return true otherwise will return false |
errors | array [] | "string" | Indicate if there was an error |
messages | array [] | "string" | Returns the response message from back-end |
result | array [object] | Returns an object of roles | |
id | string | "string" | Returns the identifier of all roles |
name | string | "string" | Returns all the names of roles |
description | string | "string" | Returns descriptions of all roles |
isDefault | bool | true | |
permissionCount | integer($int32) | 0 | |
resultInfo | array [object] | Returns an object of behavior | |
totalCount | integer($int32) | 0 | How many records of behavior entity are in database |
pageIndex | integer($int32) | 0 | Returns how many pages of paganed data are |
pageSize | integer($int32) | 0 | Returns paganed data |
totalPages | integer($int32) | 0 | How many pages |
hasNextPage | bool | true | Returns the next page of paganed data |
hasPreviousPage | bool | true | Returns the previous page of paganed data |
Errors
For information about the errors that are common to all actions, see Common Errors:
- HTTP Status Code: 401 Unauthorized
- HTTP Status Code: 403 Forbidden
- HTTP Status Code: 404 Not found
#
POST RoleCreate new role.
POST | |
---|---|
Method | POST |
URL or EndPoint | /api/v{version}/organizations/{organizationId}/roles |
Headers | Authorization |
Parameters | organizationId, version |
Body | { name, description, permissions[] } |
The description of the URL parameters is as follows:
URL Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
v{version} | Yes | string | v1 | Shows the version of API |
organizationId | Yes | string($uuid) | v1 | The identifier for the organization |
organizations | Yes | string | v1 | Directs to the organizations |
roles | Yes | string | v1 | Directs to the roles |
The description of the parameters is as follows:
Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
Version | Yes | string | v1 | Shows the version of API |
organizationId | Yes | string($uuid) | v1 | The identifier for the organization |
#
Request body{ "name": "string", "description": "string", "permissions": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ]}
The description of the parameters is as follows:
Body Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
name | Yes | string | "string" | Sends the name of role |
description | Yes | string | "string" | Sends the description of the role |
permissions | Yes | array [object] | "3fa85f64-5717-4562-b3fc-2c963f66afa6" | Sends an object with a permission of the role |
#
ResponsesIf the action is successful, the service sends back an HTTP 200 response.
The following data is returned in json format by the service.
{ "success": true, "errors": [ "string" ], "messages": [ "string" ], "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "description": "string", "isDefault": true, "permissionCount": 0, "isPrimary": true, "permissions": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "string", "title": "string", } ] }, "resultInfo": { "totalCount": 0, "pageIndex": 0, "pageSize": 0, "totalPages": 0, "hasNextPage": true, "hasPreviousPage": true }}
Field Name | Type | Example | Description |
---|---|---|---|
success | bool | true | If response is success will return true otherwise will return false |
errors | array [] | "string" | Indicate if there was an error |
messages | array [] | "string" | Returns the response message from back-end |
result | array [object] | Returns an object of roles | |
id | string | "string" | Returns the identifier of role |
name | string | "string" | Returns the name of role |
description | string | "string" | Returns the description of role |
isDefault | bool | true | |
permissionCount | integer($int32) | 0 | |
isPrimary | bool | true | |
permissions | array [object] | Returns an object with permissions of the role | |
id | string | "3fa85f64-5717-4562-b3fc-2c963f66afa6" | Returns the identifier of role |
type | string | "string" | Returns the type of role |
title | string | "string" | Returns the title of role |
resultInfo | array [object] | Returns an object of behavior | |
totalCount | integer($int32) | 0 | How many records of behavior entity are in database |
pageIndex | integer($int32) | 0 | Returns how many pages of paganed data are |
pageSize | integer($int32) | 0 | Returns paganed data |
totalPages | integer($int32) | 0 | How many pages |
hasNextPage | bool | true | Returns the next page of paganed data |
hasPreviousPage | bool | true | Returns the previous page of paganed data |
Errors
For information about the errors that are common to all actions, see Common Errors:
- HTTP Status Code: 401 Unauthorized
- HTTP Status Code: 403 Forbidden
- HTTP Status Code: 404 Not found
#
GET RoleGet role by id
GET | |
---|---|
Method | GET |
URL or EndPoint | /api/v{version}/organizations/{organizationId}/roles/{roleId} |
Headers | Authorization |
Parameters | organizationId, version, roleId |
Body | Not Applicable |
The description of the URL parameters is as follows:
URL Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
v{version} | Yes | string | v1 | Shows the version of API |
{organizationId} | Yes | string($uuid) | v1 | The identifier for the organization |
organizations | Yes | string | v1 | Directs to the organizations |
roles | Yes | string | v1 | Directs to the roles |
{roleId} | Yes | string($uuid) | v1 | The identifier for the role |
The description of the parameters is as follows:
Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
Version | Yes | string | v1 | Shows the version of API |
roleId | Yes | string($uuid) | v1 | The identifier for the role |
#
Request BodyThe request does not have a request body.
#
ResponsesIf the action is successful, the service sends back an HTTP 200 response.
The following data is returned in json format by the service.
{ "success": true, "errors": [ "string" ], "messages": [ "string" ], "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "description": "string", "isDefault": true, "permissionCount": 0, "isPrimary": true, "permissions": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "string", "title": "string" } ] }, "resultInfo": { "totalCount": 0, "pageIndex": 0, "pageSize": 0, "totalPages": 0, "hasNextPage": true, "hasPreviousPage": true }}
Field Name | Type | Example | Description |
---|---|---|---|
success | bool | true | If response is success will return true otherwise will return false |
errors | array [] | "string" | Indicate if there was an error |
messages | array [] | "string" | Returns the response message from back-end |
result | array [object] | Returns an object of roles | |
id | string | "string" | Returns the identifier of role |
name | string | "string" | Returns the name of role |
description | string | "string" | Returns the description of role |
isDefault | bool | true | |
permissionCount | integer($int32) | 0 | |
isPrimary | bool | true | |
permissions | array [object] | Returns an object with permissions of the role | |
id | string | "3fa85f64-5717-4562-b3fc-2c963f66afa6" | Returns the identifier of role |
type | string | "string" | Returns the type of role |
title | string | "string" | Returns the title of role |
resultInfo | array [object] | Returns an object of behavior | |
totalCount | integer($int32) | 0 | How many records of behavior entity are in database |
pageIndex | integer($int32) | 0 | Returns how many pages of paganed data are |
pageSize | integer($int32) | 0 | Returns paganed data |
totalPages | integer($int32) | 0 | How many pages |
hasNextPage | bool | true | Returns the next page of paganed data |
hasPreviousPage | bool | true | Returns the previous page of paganed data |
Errors
For information about the errors that are common to all actions, see Common Errors:
- HTTP Status Code: 401 Unauthorized
- HTTP Status Code: 403 Forbidden
- HTTP Status Code: 404 Not found
#
PUT RoleUpdates a role.
PUT | |
---|---|
Method | PUT |
URL or EndPoint | /api/v{version}/organizations/{organizationId}/roles/{roleId} |
Headers | Authorization |
Parameters | organizationId, version, roleId |
Body | { name, description, permissions[] } |
The description of the URL parameters is as follows:
URL Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
v{version} | Yes | string | v1 | Shows the version of API |
{organizationId} | Yes | string($uuid) | v1 | The identifier for the organization |
organizations | Yes | string | v1 | Directs to the organizations |
roles | Yes | string | v1 | Directs to the roles |
{roleId} | Yes | string($uuid) | v1 | The identifier for the role |
The description of the parameters is as follows:
Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
Version | Yes | string | v1 | Shows the version of API |
roleId | Yes | string($uuid) | v1 | The identifier for the role |
#
Request body{ "name": "string", "description": "string", "permissions": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ]}
The description of the parameters is as follows:
Body Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
name | Yes | string | "string" | Sends the name of updated role |
description | Yes | string | "string" | Sends the name of updated role |
permissions | Yes | array [object] | "3fa85f64-5717-4562-b3fc-2c963f66afa6" | Sends an object of updated permissions of role |
#
ResponsesIf the action is successful, the service sends back an HTTP 200 response.
The following data is returned in json format by the service.
{ "success": true, "errors": [ "string" ], "messages": [ "string" ], "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "description": "string", "isDefault": true, "permissionCount": 0, "isPrimary": true, "permissions": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "string", "title": "string" } ] }, "resultInfo": { "totalCount": 0, "pageIndex": 0, "pageSize": 0, "totalPages": 0, "hasNextPage": true, "hasPreviousPage": true }}
Field Name | Type | Example | Description |
---|---|---|---|
success | bool | true | If response is success will return true otherwise will return false |
errors | array [] | "string" | Indicate if there was an error |
messages | array [] | "string" | Returns the response message from back-end |
result | array [object] | Returns an object of roles | |
id | string | "string" | Returns the identifier of role |
name | string | "string" | Returns the name of role |
description | string | "string" | Returns the description of role |
isDefault | bool | true | |
permissionCount | integer($int32) | 0 | |
isPrimary | bool | true | |
permissions | array [object] | Returns an object with permissions of the role | |
id | string | "3fa85f64-5717-4562-b3fc-2c963f66afa6" | Returns the identifier of role |
type | string | "string" | Returns the type of role |
title | string | "string" | Returns the title of role |
resultInfo | array [object] | Returns an object of behavior | |
totalCount | integer($int32) | 0 | How many records of behavior entity are in database |
pageIndex | integer($int32) | 0 | Returns how many pages of paganed data are |
pageSize | integer($int32) | 0 | Returns paganed data |
totalPages | integer($int32) | 0 | How many pages |
hasNextPage | bool | true | Returns the next page of paganed data |
hasPreviousPage | bool | true | Returns the previous page of paganed data |
Errors
For information about the errors that are common to all actions, see Common Errors:
- HTTP Status Code: 401 Unauthorized
- HTTP Status Code: 403 Forbidden
- HTTP Status Code: 404 Not found
#
DELETE RoleDeletes role using id.
DELETE | |
---|---|
Method | DELETE |
URL or EndPoint | /api/v{version}/organizations/{organizationId}/roles/{roleId} |
Headers | Authorization |
Parameters | organizationId, version, roleId |
Body |
The description of the URL parameters is as follows:
URL Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
v{version} | Yes | string | v1 | Shows the version of API |
{organizationId} | Yes | string | v1 | The identifier for the organization |
organizations | Yes | string | v1 | Directs to the organizations |
roles | Yes | string | v1 | Directs to the roles |
{roleId} | Yes | string($uuid) | v1 | The identifier for the role |
The description of the parameters is as follows:
Parameter Name | Mandatory | Type | Example | Description |
---|---|---|---|---|
Version | Yes | string | v1 | Shows the version of API |
roleId | Yes | string($uuid) | v1 | The identifier for the role |
#
Request BodyThe request does not have a request body.
#
ResponsesIf the action is successful, the service sends back an HTTP 200 response.
The following data is returned in json format by the service.
{ "success": true, "errors": [ "string" ], "messages": [ "string" ], "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "description": "string", "isDefault": true, "permissionCount": 0, "isPrimary": true, "permissions": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "string", "title": "string" } ] }, "resultInfo": { "totalCount": 0, "pageIndex": 0, "pageSize": 0, "totalPages": 0, "hasNextPage": true, "hasPreviousPage": true }}
Field Name | Type | Example | Description |
---|---|---|---|
success | bool | true | If response is success will return true otherwise will return false |
errors | array [] | "string" | Indicate if there was an error |
messages | array [] | "string" | Returns the response message from back-end |
result | array [object] | Returns an object of roles | |
id | string | "string" | Returns the identifier of role |
name | string | "string" | Returns the name of role |
description | string | "string" | Returns the description of role |
isDefault | bool | true | |
permissionCount | integer($int32) | 0 | |
isPrimary | bool | true | |
permissions | array [object] | Returns an object with permissions of the role | |
id | string | "3fa85f64-5717-4562-b3fc-2c963f66afa6" | Returns the identifier of role |
type | string | "string" | Returns the type of role |
title | string | "string" | Returns the title of role |
resultInfo | array [object] | Returns an object of roles | |
totalCount | integer($int32) | 0 | How many records of behavior entity are in database |
pageIndex | integer($int32) | 0 | Returns how many pages of paganed data are |
pageSize | integer($int32) | 0 | Returns paganed data |
totalPages | integer($int32) | 0 | How many pages |
hasNextPage | bool | true | Returns the next page of paganed data |
hasPreviousPage | bool | true | Returns the previous page of paganed data |
Errors
For information about the errors that are common to all actions, see Common Errors:
- HTTP Status Code: 401 Unauthorized
- HTTP Status Code: 403 Forbidden
- HTTP Status Code: 404 Not found