Icon Web Server Administration API - Roles


Add Role Request
The add role request adds the role provided in the included JSON content. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: POST

HTTP Request Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=addrole

Example Request Content:

{
   "Name": "CustomerService",
   "Description": "Customer Service Role"
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Update Role Request
The update role request updates the role provided in the included JSON content. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: POST

HTTP Request Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=updaterole

Example Request Content:

{
   "Name": "CustomerService",
   "Description": "Customer Service Role"
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Remove Role Request
The remove role request removes the role provided in the included JSON content. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: POST

HTTP Request Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=removerole

Example Request Content:

{
   "Name": "CustomerService"
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Activate Role Request
The activate role request changes the status of the role provided in the included JSON content to active. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: POST

HTTP Request Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=activaterole

Example Request Content:

{
   "Name": "CustomerService"
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Deactivate Role Request
The deactivate role request changes the status of the role provided in the included JSON content to inactive. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: POST

HTTP Request Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=deactivaterole

Example Request Content:

{
   "Name": "CustomerService"
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Grant Role Privileges Request
The grant role privileges request grants a set of privileges to the role provided in the included JSON content. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: POST

HTTP Request Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=grantroleprivileges

Example Request Content:

{
   "Name": "CustomerService",
   "Privileges": ["AddCustomer", "UpdateCustomer", "ViewInvoices"]
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Revoke Role Privileges Request
The revoke role privileges request revokes a set of privileges from the role provided in the included JSON content. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: POST

HTTP Request Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=revokeroleprivileges

Example Request Content:

{
   "Name": "CustomerService",
   "Privileges": ["AddCustomer", "UpdateCustomer", "ViewInvoices"]
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Get Role Privileges Request
The get role privileges request enumerates all of the privileges assigned to the role provided in the included JSON content. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: GET

HTTP Response Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=getroleprivileges

Example Request Content:

{
   "Name": "CustomerService"
}

Example Response Content:

{
   "Privileges": ["AddCustomer", "UpdateCustomer", "ViewInvoices"]
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error


Get Roles Request
The get roles request enumerates all of the roles defined on the web server. If there is no active session or the session is not authenticated, the request will result in a 403 Forbidden HTTP response.

HTTP Method: GET

HTTP Response Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=getroles

Example Response Content:

{
   "Roles": [
      { "Name": "Administrators",
        "Active": true,
        "Description": "Administrators Role",
        "Privileges": [{ "Name": "AddDatabase" },
                       { "Name": "AddDataSet" },
                       { "Name": "AddDataSetCommand" },
                       { "Name": "AddPrivilege" },
                       { "Name": "AddRole" },
                       { "Name": "AddSystemEvent" }] },
      { "Name": "CustomerService",
        "Active": true,
        "Description": "Customer Service",
        "Privileges": [{ "Name": "AddCustomer" },
                       { "Name": "UpdateCustomer" },
                       { "Name": "ViewInvoices" }] },
      { "Name": "Public",
        "Active": true,
        "Description": "Public Role",
        "Privileges": [] }]
}

HTTP Response: 200 on success, 403 if not authenticated, and 500 on error
Image