FAQs – REST API
If there are errors executing a REST API call, you can check the OAS Configuration app, click on the triangle icon (should be flashing of there's an error) and you'll see system errors.
Locate the REST API and expand it out and you should see the failed calls. But it often won't give you the detailed HTTP request/response and just contain the failed URL that was attempted. It's a good way to see if people are hitting incorrect endpoints.
If you use Postman to execute REST API calls, you can see the proper URLs, headers, body contents, etc. for making proper calls.
If you ever get these response or codes, this is what they mean:
401: Unauthorized - you have not included the clientid and token fields in the request header, or the session has expired
500: Unknown server error - this may be something we need to investigate since the data was submitted properly but an error occurred on the server processing the request.
404: The object you're trying to GET or PUT (update) does not exist
If you see "Service Unavailable" that means the REST API did not start up properly.
If you see a message indicating the Endpoint does not exist, this means the URL is not correct for the call.
If there's something specific you're attempting and don't know what the issue is, you can always look at a successful call from Postman's console and it will expose everything in the request header/body and response header/body. You can compare it to your failing call to see what you might need, such as the correct Content-type. You can always let us know what call you're stuck on and we can investigate why it might not work for you.
REST API
The OAS Platform REST API, like all APIs is a programmatic interface. It allows developers to read and write real time Tag data, read real time and historical Alarms and Trends, and even create or update Tag configurations. Because it utilizes JSON data over HTTP(s), it can be used by any virtually any development platform or language. It is also a perfect alternative to the .NET Data Connector for applications not running .NET code. Developers need to handle client to server communication to the API within their code. This includes web technologies such as Javascript, but if browser visualization is required, Web HMI may be the preferred product to utilize.
REST API Language Support
- Any language that can support sending JSON over HTTP/S (.NET, PHP, Python, JS, NodeJS, Java, and more)
- Fully documented and interactive API found here
Typical Applications
- Automated solutions without the need for a user interface or data visualization
- Programmatic configuration of the OAS Platform when using the .NET Data Connector is not possible (e.g. your platform is not .NET)
- Native mobile applications
Skills Required
- Knowledge of HTTP processes and methods
- Familiarity with JSON object structures
Learn more about the OAS REST API >>
Web HMI
The Web HMI product is specifically geared towards web applications that need to visualize real time and historical data. It consists of a set of Javascript libraries intended to be included in your web pages which handle server communication and screen updates. While the Web HMI product does include programmatic methods for reading and writing Tag data, development is strictly done within HTML and intended to be run in a browser.
Web HMI Language and Platform Support
- Any web application platform - built on standards (HTML, CSS, Javascript)
- Any web development platform
- Purely a Javascript solution for browser-to-OAS communications
Typical Applications
- Real time and historical data visualization
- System management and control user interfaces
- Browser-based desktop and mobile applications
Skills Required
- Web application development skills
- Familiarity with JSON object structures
- Javascript skills for direct access to the Web HMI script library functions