Global_Role

You need the Manage Agent & Agent Roles permission to manage roles.

Global_Roles
- Global_Roles Manage
GET global/roles
GET global/roles/{id}
POST global/roles
PUT global/roles/{id}
DELETE global/roles/{id}
Model
Global_Role JSON Format

Global_Role is represented as simple flat JSON objects with the following keys:

Name Type Description
id guid Id of the role.
name string Name of the role.
description string Description of the role.
type string "Administrators" and "AllAgents" are the system role types. They cannot be deleted.Allowed values are "Administrators", "AllAgents", "Custom".
agentIds array The selected agents for this role.If not offered, will use role identifier of "AllAgents" as default.
permissionIds array Permissions assigned to this role.
Endpoint
Get the list of Global_Roles

GET global/roles

Parameters:
Name Type In Required Description
include string query no Allowed values are "agent", "permission".
Response:

An array of   Global_Role

Example

Sample Request:

curl https://api15.comm100.io/v4/global/roles \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

[{"id":"e5dc1c9f-b6fd-48c7-ab73-9b02431432e1","name":"Pre-sale","description":"Pre-sale role","type":"Custom","agentIds":["3FA2EF45-7D46-EB11-8100-00155D081D0B"],"permissionIds":["4,5"]}]
Get a single Global_Role

GET global/roles/{id}

Parameters:
Name Type In Required Description
include string query no Allowed values are "agent", "permission".
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/global/roles/e5dc1c9f-b6fd-48c7-ab73-9b02431432e1 \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"id":"e5dc1c9f-b6fd-48c7-ab73-9b02431432e1","name":"Pre-sale","description":"Pre-sale role","type":"Custom","agentIds":["3FA2EF45-7D46-EB11-8100-00155D081D0B"],"permissionIds":["4,5"]}
Create a new Global_Role

POST global/roles

Parameters:
Name Type In Required Description
name string body yes Name of the role.
description string body no Description of the role.
type string body no "Administrators" and "AllAgents" are the system role types. They cannot be deleted.Allowed values are "Administrators", "AllAgents", "Custom".
agentIds array body no The selected agents for this role.If not offered, will use role identifier of "AllAgents" as default.
permissionIds array body no Permissions assigned to this role.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/global/roles \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"name":"Pre-sale","description":"Pre-sale role","type":"Custom"}'

Response:

 HTTP/1.1 201 Created

{"id":"e5dc1c9f-b6fd-48c7-ab73-9b02431432e1","name":"Pre-sale","description":"Pre-sale role","type":"Custom","agentIds":["3FA2EF45-7D46-EB11-8100-00155D081D0B"],"permissionIds":["4,5"]}
Update the Global_Role

PUT global/roles/{id}

Parameters:
Name Type In Required Description
name string body yes Name of the role.
description string body no Description of the role.
type string body no "Administrators" and "AllAgents" are the system role types. They cannot be deleted.Allowed values are "Administrators", "AllAgents", "Custom".
agentIds array body no The selected agents for this role.If not offered, will use role identifier of "AllAgents" as default.
permissionIds array body no Permissions assigned to this role.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/global/roles/e5dc1c9f-b6fd-48c7-ab73-9b02431432e1 \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"name":"Pre-sale","description":"Pre-sale role","type":"Custom"}'

Response:

 HTTP/1.1 200 OK

{"id":"e5dc1c9f-b6fd-48c7-ab73-9b02431432e1","name":"Pre-sale","description":"Pre-sale role","type":"Custom","agentIds":["3FA2EF45-7D46-EB11-8100-00155D081D0B"],"permissionIds":["4,5"]}
Remove the Global_Role

DELETE global/roles/{id}

Parameters:
No Parameters
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/global/roles/e5dc1c9f-b6fd-48c7-ab73-9b02431432e1 \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 204 No Content