Icon Web Server Administration API - Databases

The engine type provided in the included JSON content for several of the database requests should be one of the following:

TypeEngine
0ElevateDB
1DBISAM
2ADO/ODBC

In addition, several of the database requests also allow specifying database connection properties that are specific to the type of database engine.


Test Database Request
The test database request tests the database 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=testdatabase

Example Request Content:

{
   "Name": "Invoicing",
   "Description": "Invoicing Database",
   "EngineType": 0,
   "Properties": { "CharacterSet": 1,
                   "DatabaseName": "Test",
                   "LoginPassword": "DBUser123456",
                   "LoginUser": "DBUser",
                   "RemoteAddress": "127.0.0.1",
                   "SessionDescription": "EWB Session",
                   "SessionName": "EWB",
                   "SessionType": 1 }
}

Example Response Content:

{
   "Result": true,
   "Message": ""
}

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


Add Database Request
The add database request adds the database 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=adddatabase

Example Request Content:

{
   "Name": "Invoicing",
   "Description": "Invoicing Database",
   "EngineType": 0,
   "Properties": { "CharacterSet": 1,
                   "DatabaseName": "Test",
                   "LoginPassword": "DBUser123456",
                   "LoginUser": "DBUser",
                   "RemoteAddress": "127.0.0.1",
                   "SessionDescription": "EWB Session",
                   "SessionName": "EWB",
                   "SessionType": 1 }
}

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


Update Database Request
The update database request updates the database 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=updatedatabase

{
   "Name": "Invoicing",
   "Description": "Invoicing Database",
   "EngineType": 0,
   "Properties": { "CharacterSet": 1,
                   "DatabaseName": "Test",
                   "LoginPassword": "DBUser123456",
                   "LoginUser": "DBUser",
                   "RemoteAddress": "127.0.0.1",
                   "SessionDescription": "EWB Session",
                   "SessionName": "EWB",
                   "SessionType": 1 }
}

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


Rename Database Request
The remame database request renames the database provided in the included JSON content to a new name. 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=renamedatabase

Example Request Content:

{
   "Name": "Invoicing",
   "NewName": "InvoicingDB"
}

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


Remove Database Request
The remove database request removes the database 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=removedatabase

Example Request Content:

{
   "Name": "Invoicing"
}

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


Get Database Privileges Request
The get database privileges request retrieves the access privilege assigned to the database provided in the included JSON content. If the access privilege has not been specified, then the database is accessible to all users. 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 Request Content Type: application/json; charset=utf-8
HTTP Response Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=getdatabaseprivileges

Example Request Content:

{
   "Name": "Invoicing"
}

Example Response Content:

{
   "Privilege": "InvoicingData"]
}

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


Set Database Privileges Request
The set database privileges request assigns the access privilege for the database provided in the included JSON content. If the access privilege is not specified, then the database will be accessible to all users. 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=setdatabaseprivileges

Example Request Content:

{
   "Name": "Invoicing",
   "Privilege": "InvoicingData"
}

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


Get Database Tables Request
The get database tables request enumerates all of the tables available in the database 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.

Information The successful connection to the underlying database is required for this request to succeed. If the underlying database is not available for any reason, then an error indicating the reason will be returned.

HTTP Method: GET

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

Example Request:

https://localhost/administration?method=getdatabasetables

Example Request Content:

{
   "Name": "Invoicing"
}

Example Response Content:

{
   "Tables": ["Customer", "InvoiceHeader", "InvoiceDetail"]
}

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


Get Databases Request
The get databases request enumerates all of the databases 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=getdatabases

Example Response Content:

{
   "Databases": [
      { "Name": "Invoicing",
        "Description": "Invoicing Database",
        "EngineType": 0,
        "Properties": { "CharacterSet": 1,
                        "DatabaseName": "Test",
                        "LoginPassword": "DBUser123456",
                        "LoginUser": "DBUser",
                        "RemoteAddress": "127.0.0.1",
                        "SessionDescription": "EWB Session",
                        "SessionName": "EWB",
                        "SessionType": 1 },
        "DataSets": [{ "Name": "Customers",
                       "Description": "Customers DataSet",
                       "LocalizeDateTimes": false,
                       "Commands": [{ "Name": "Select",
                                      "Description": "", "SQL": "SELECT * FROM customer",
                                      "Logged": false,
                                      "Privilege": "" },
                                    { "Name": "Insert",
                                      "Description": "", "SQL": "INSERT INTO customer VALUES (:CustNo, :InvoiceNo, :InvoiceDate)",
                                      "Logged": false,
                                      "Privilege": "" }] }] }]
}

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


Add DataSet Request
The add dataset request adds the dataset provided in the included JSON content. The LocalizeDateTimes property specifies whether date-time column values should be localized when read or written from the dataset. 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=adddataset

Example Request Content:

{
   "Database": "Invoicing",
   "Name": "Customers",
   "Description": "Customers DataSet",
   "LocalizeDateTimes": false
}

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


Update DataSet Request
The update dataset request updates the dataset provided in the included JSON content. The LocalizeDateTimes property specifies whether date-time column values should be localized when read or written from the dataset. 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=updatedataset

{
   "Database": "Invoicing",
   "Name": "Customers",
   "Description": "Customers DataSet",
   "LocalizeDateTimes": false
}

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


Rename DataSet Request
The remame dataset request renames the dataset provided in the included JSON content to a new name. 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=renamedataset

Example Request Content:

{
   "Database": "Invoicing",
   "Name": "Customers",
   "NewName": "Customer"
}

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


Remove DataSet Request
The remove datasete request removes the dataset 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=removedataset

Example Request Content:

{
   "Database": "Invoicing",
   "Name": "Customers"
}

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


Generate DataSet Commands Request
The generate dataset commands request generates commands for the dataset provided in the included JSON content. The BaseTableName property specifies which base table to use for generating the commands, and the remaining properties specify which commands should be generated. 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=generatedatasetcommands

Example Request Content:

{
   "Database": "Invoicing",
   "Name": "Customers",
   "BaseTableName": "Customer",
   "SelectCommand": true,
   "InsertCommand": true,
   "UpdateCommand": true,
   "DeleteCommand": true,
   "BLOBSelectCommands": true,
   "BLOBUpdateCommands": true
}

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


Add DataSet Command Request
The add dataset command request adds the dataset command provided in the included JSON content. The Logged property specifies that any execution of the dataset command should be logged in the system log. Please see the Web Server Logging topic for more information on the system logging. 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=adddatasetcommand

Example Request Content:

{
   "Database": "Invoicing",
   "DataSet": "Customers",
   "Name": "Select",
   "Description": "",
   "SQL": "SELECT * FROM customer",
   "Logged": false
}

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


Update DataSet Command Request
The update dataset command request updates the dataset command provided in the included JSON content. The Logged property specifies that any execution of the dataset command should be logged in the system log. Please see the Web Server Logging topic for more information on the system logging. 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=updatedatasetcommand

{
   "Database": "Invoicing",
   "DataSet": "Customers",
   "Name": "Select",
   "Description": "",
   "SQL": "SELECT * FROM customer",
   "Logged": false
}

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


Rename DataSet Command Request
The remame dataset command request renames the dataset command provided in the included JSON content to a new name. 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=renamedatasetcommand

Example Request Content:

{
   "Database": "Invoicing",
   "DataSet": "Customers",
   "Name": "Select",
   "NewName": "SelectCommand"
}

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


Remove DataSet Command Request
The remove dataset command request removes the dataset command 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=removedatasetcommand

Example Request Content:

{
   "Database": "Invoicing",
   "DataSet": "Customers",
   "Name": "Select"
}

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


Get DataSet Command Privileges Request
The get dataset command privileges request retrieves the access privilege assigned to the dataset command provided in the included JSON content. If the access privilege has not been specified, then the dataset command is accessible to all users. 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 Request Content Type: application/json; charset=utf-8
HTTP Response Content Type: application/json; charset=utf-8

Example Request:

https://localhost/administration?method=getdatasetcommandprivileges

Example Request Content:

{
   "Database": "Invoicing",
   "DataSet": "Customers",
   "Name": "Select"
}

Example Response Content:

{
   "Privilege": ""
}

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


Set DataSet Command Privileges Request
The set dataset command privileges request assigns the access privilege for the dataset command provided in the included JSON content. If the access privilege is not specified, then the dataset command will be accessible to all users. 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=setdatasetcommandprivileges

Example Request Content:

{
   "Database": "Invoicing",
   "DataSet": "Customers",
   "Name": "Select",
   "Privilege": "ViewCustomers",
}

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