An Industrial IOT Platform

Developers

Open-Plant provides a wide range of options for developers of any sort to develop their own solutions on top of Open-Plant. Whether it's for the web or for Microsoft Windows DotNet, Open-Plant has it covered. This section provides the necessary support for developers.

Getting Started

First and foremost, you must download and install the Open-Plant Full Version. It's FREE.
Download Open-Plant
View Web APIs

Web API Configuration

Open-Plant Web APIs can be configured from the Open-Plant Client. Select 'Web API' from the main screen.  




This brings the Web API configuration section shown below. The section includes a log of all Web API calls made to the system. The default port for all Web API calls are 33170 for Secure HTTP (HTTPS) and 33171 for HTTP. 

NOTE: 
The secure HTTPS provides a standard SSL encryption for data communication. The certificate is self-signed. To use an externally signed certificate you may need to perform a reverse proxy on the HTTP port. This is beyond the scope of Open-Plant as you will need to configure your windows server IIS.


Advance Information

In the configuration screen above, a few advance terminologies are as follows:

SANs (Subject Alternative Names)
Subject Alternative Names are your server host names which Open-Plant uses to generate a self signed certificate for SSL access. If you installed Open-Plant a unique hostname, make sure to include it here. For example, if you install Open-Plant on a server name "www.myAwesomeServer.com", the SANs entry should be "localhost,127.0.0.1,www.myAwesomeServer.com"

Enable CORS (Cross Origin Resources Sharing)
This should be enabled by default. CORS is a mechanism that allows a webpage from another domain to create Web API calls to the Open-Plant Server. If your application (which connects to Open-Plant) is hosted on a different server and different port, you need this to be enabled.

Let's create a simple Web API Call

For this test, uncheck the 'Enable Basic Authentication' check box on click 'Save'.


Open your web browser and browse to 'http://localhost:33171/api/users'.
A JSON data of users in the installed system should appear as below:

Web API Authentication

To avoid unwanted users from accessing the your Open-Plant Data, Open-Plant provides Basic Authentication for the Web APIs. Basic Authentication is basically a username and a password, which needs to be set on every Web API call. The usernames allowed are the usernames that are configured on the system. The users configured needs to have an access level higher than 'Min Read Access' or 'Min Write Access'.

Adding a Web API User
Web API Users are standard users. To add a new user, click on the 'Users' icon on the Open-Plant main screen.


The following 'Users' section should appear as follows. For this test, add a user named 'webapi' and give it's access level 6.

Let's create a Web API Call with Basic Authentication

For this test, make sure the 'Enable Basic Authentication' in the Web API Configuration section is checked.




Open your web browser and browse to 'http://localhost:33171/api/users'. The browser will now ask for a username and password. Enter the Web API username you provided and the result should appear.

Web API Logs

Open-Plant will log every web api call. You can view the logs at the WebAPI Configuration section in the Open-Plant client. You may also troubleshoot any failed Web API Calls here.

Javascript Code Example

The following is an example of a Web API Call made using Javascript for Open-Plant.

Web API GET Example Code


The following is the most basic connection to an Open-Plant System (installed in localhost). For this to work "Enable Basic Authentication" must be disabled.

function TestWebAPICall() {
	var xhttp = new XMLHttpRequest();
	xhttp.onreadystatechange = function () {
		if (this.readyState == 4 && this.status == 200) {
			console.log("Web API call successful!");
			console.log(this.responseText);
		}
	};
	xhttp.open("GET", "http://localhost:33171/api/users");
	xhttp.send();
}
TestWebAPICall();

Web API GET Example Code with Basic Authenticaton


The following is a code sample used to connect to an Open-Plant System (installed in localhost), with Basic Authentication provided (Username and Password).
 
function TestWebAPICall() {
	var xhttp = new XMLHttpRequest();
	xhttp.onreadystatechange = function () {
		if (this.readyState == 4 && this.status == 200) {
			console.log("Web API call successful!");
			console.log(this.responseText);
		}
	};
	xhttp.open("GET", "http://localhost:33171/api/users");
	xhttp.setRequestHeader("Authorization", "Basic " + btoa("Username:Password"));
	xhttp.send();
}
TestWebAPICall();
Open-Plant is a revolutionary Industrial IOT Platform software, used to create and deploy Industrial IT apps/solutions. It is an all-encompassing solution offering both back-end and front-end components i.e. the full stack. From our user's experience, creating and deploying Industrial IT apps became 10x faster and 10x less cost. We serve the mining, energy, oil & gas, construction and manufacturing industry. 

OPEN-PLANT PTY LTD

Perth, Australia

EMAIL

info@open-plant.com
homedownloadenvelope