Skip to main content

Roles

GET Roles#

Get all roles.

GET ALL
MethodGET ALL
URL or EndPoint/api/v{version}/organizations/{organizationId}/roles
HeadersAuthorization
ParametersorganizationId, version
BodyNot Applicable

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
organizationIdYesstring($uuid)v1The identifier for the organization
organizationsYesstringv1Directs to the organizations
rolesYesstringv1Directs to the roles

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
VersionYesstringv1Shows the version of API
organizationIdYesstring($uuid)v1The identifier for the organization

Request Body#

The request does not have a request body.

Responses#

If 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 NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsarray []"string"Indicate if there was an error
messagesarray []"string"Returns the response message from back-end
resultarray [object]Returns an object of roles
idstring"string"Returns the identifier of all roles
namestring"string"Returns all the names of roles
descriptionstring"string"Returns descriptions of all roles
isDefaultbooltrue
permissionCountinteger($int32)0
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns 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 Role#

Create new role.

POST
MethodPOST
URL or EndPoint/api/v{version}/organizations/{organizationId}/roles
HeadersAuthorization
ParametersorganizationId, version
Body{ name, description, permissions[] }

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
organizationIdYesstring($uuid)v1The identifier for the organization
organizationsYesstringv1Directs to the organizations
rolesYesstringv1Directs to the roles

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
VersionYesstringv1Shows the version of API
organizationIdYesstring($uuid)v1The 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 NameMandatoryTypeExampleDescription
nameYesstring"string"Sends the name of role
descriptionYesstring"string"Sends the description of the role
permissionsYesarray [object]"3fa85f64-5717-4562-b3fc-2c963f66afa6"Sends an object with a permission of the role

Responses#

If 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 NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsarray []"string"Indicate if there was an error
messagesarray []"string"Returns the response message from back-end
resultarray [object]Returns an object of roles
idstring"string"Returns the identifier of role
namestring"string"Returns the name of role
descriptionstring"string"Returns the description of role
isDefaultbooltrue
permissionCountinteger($int32)0
isPrimarybooltrue
permissionsarray [object]Returns an object with permissions of the role
idstring"3fa85f64-5717-4562-b3fc-2c963f66afa6"Returns the identifier of role
typestring"string"Returns the type of role
titlestring"string"Returns the title of role
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns 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 Role#

Get role by id

GET
MethodGET
URL or EndPoint/api/v{version}/organizations/{organizationId}/roles/{roleId}
HeadersAuthorization
ParametersorganizationId, version, roleId
BodyNot Applicable

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{organizationId}Yesstring($uuid)v1The identifier for the organization
organizationsYesstringv1Directs to the organizations
rolesYesstringv1Directs to the roles
{roleId}Yesstring($uuid)v1The identifier for the role

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
VersionYesstringv1Shows the version of API
roleIdYesstring($uuid)v1The identifier for the role

Request Body#

The request does not have a request body.

Responses#

If 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 NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsarray []"string"Indicate if there was an error
messagesarray []"string"Returns the response message from back-end
resultarray [object]Returns an object of roles
idstring"string"Returns the identifier of role
namestring"string"Returns the name of role
descriptionstring"string"Returns the description of role
isDefaultbooltrue
permissionCountinteger($int32)0
isPrimarybooltrue
permissionsarray [object]Returns an object with permissions of the role
idstring"3fa85f64-5717-4562-b3fc-2c963f66afa6"Returns the identifier of role
typestring"string"Returns the type of role
titlestring"string"Returns the title of role
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns 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 Role#

Updates a role.

PUT
MethodPUT
URL or EndPoint/api/v{version}/organizations/{organizationId}/roles/{roleId}
HeadersAuthorization
ParametersorganizationId, version, roleId
Body{ name, description, permissions[] }

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{organizationId}Yesstring($uuid)v1The identifier for the organization
organizationsYesstringv1Directs to the organizations
rolesYesstringv1Directs to the roles
{roleId}Yesstring($uuid)v1The identifier for the role

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
VersionYesstringv1Shows the version of API
roleIdYesstring($uuid)v1The 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 NameMandatoryTypeExampleDescription
nameYesstring"string"Sends the name of updated role
descriptionYesstring"string"Sends the name of updated role
permissionsYesarray [object]"3fa85f64-5717-4562-b3fc-2c963f66afa6"Sends an object of updated permissions of role

Responses#

If 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 NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsarray []"string"Indicate if there was an error
messagesarray []"string"Returns the response message from back-end
resultarray [object]Returns an object of roles
idstring"string"Returns the identifier of role
namestring"string"Returns the name of role
descriptionstring"string"Returns the description of role
isDefaultbooltrue
permissionCountinteger($int32)0
isPrimarybooltrue
permissionsarray [object]Returns an object with permissions of the role
idstring"3fa85f64-5717-4562-b3fc-2c963f66afa6"Returns the identifier of role
typestring"string"Returns the type of role
titlestring"string"Returns the title of role
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns 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 Role#

Deletes role using id.

DELETE
MethodDELETE
URL or EndPoint/api/v{version}/organizations/{organizationId}/roles/{roleId}
HeadersAuthorization
ParametersorganizationId, version, roleId
Body

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{organizationId}Yesstringv1The identifier for the organization
organizationsYesstringv1Directs to the organizations
rolesYesstringv1Directs to the roles
{roleId}Yesstring($uuid)v1The identifier for the role

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
VersionYesstringv1Shows the version of API
roleIdYesstring($uuid)v1The identifier for the role

Request Body#

The request does not have a request body.

Responses#

If 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 NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsarray []"string"Indicate if there was an error
messagesarray []"string"Returns the response message from back-end
resultarray [object]Returns an object of roles
idstring"string"Returns the identifier of role
namestring"string"Returns the name of role
descriptionstring"string"Returns the description of role
isDefaultbooltrue
permissionCountinteger($int32)0
isPrimarybooltrue
permissionsarray [object]Returns an object with permissions of the role
idstring"3fa85f64-5717-4562-b3fc-2c963f66afa6"Returns the identifier of role
typestring"string"Returns the type of role
titlestring"string"Returns the title of role
resultInfoarray [object]Returns an object of roles
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns 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