FAQs – REST API

How do I troubleshoot REST API calls?

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.

What's the difference between the REST API and Web HMI?

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

Learn more about OAS Web HMI >>

Can the REST API push data to another destination?
REST APIs by their very nature are HTTP services. This means that they are based on a request/response model. They are not event-driven and not capable of pushing data to a destination. You can poll against the REST API for updated values, but the data is only as current as the polling rate. So if the polling rate is longer than the refresh rate on the server value, you may miss updates. If you would like to move data based on events, you must write your own solutions using one of our other developer tools, such as the .NET Data Connector or the Universal Driver Interface.
Is the REST API secure?
YES! There are two levels of security when using the REST API. The first is the authentication required for all operations. You first perform an authentication call using a credential configured within the OAS Server. Then, you can encrypt all communications over the wire by using an SSL certificate and restrict the REST API to using only SSL communications.
After authentication, how long can I use the token and clientid?
The security token and client id granted to the caller after authentication represent a REST API session. As long as the server remains active (not rebooted), and the credentials are continually used, the session will not expire. If there is no activity on the session after 30 minutes, the session will expire and a 401 Unauthorized response will be returned for all operations. This idle timeout can be configured on the server using the OAS Configuration app. Go to Configure > Options, select your OAS server (usually localhost when configuring the current machine) and then go to the Networking tab. Here you can set the REST API Session Timeout in minutes.
When would I use the REST API?
The OAS Platform allows for connectivity and integration with many systems and devices. It also exposes tools for direct data integration and automation using .NET for Windows developers, and libraries for integration with web technologies. If you are developing custom software that runs on other platforms that do not host the .NET Framework, and if you prefer to develop more robust applications with or without user interfaces, the REST API is a perfect solution. It exposes functions for reading and writing real time and historical data, as well as operations for customizing the OAS tag configurations themselves.
How do I test the REST API?
The OAS REST API was developed as a standard REST API, and we have exposed our demo server for you to experiment with it using your own tools. We have also published the full REST API documentation online and have integrated it with the popular Postman tool. This free tool allows you to test operations without writing code, and then generate sample code to get you started. In fact, in our online documentation, just click "Run in Postman" and it will download the full API with examples to your Postman instance. Within Postman, you can then point to your own OAS server to test the REST API with your own data. Read more about Getting Started with REST API.
Can the REST API connect to other REST APIs?
REST APIs expose data or operations in a system via HTTP calls. The OAS REST API is no different in this regard, so it is intended to be used by 3rd party clients and developer tools. If you would like to connect to another 3rd party REST API and integrate the data into OAS Tags, you can use either the .NET Data Connector, or the Universal Driver Interface to develop a custom solution.
Can you run the REST API over SSL?
Yes, the REST API as well as Web HMI can be run over SSL. You must first install an SSL Certificate on your server for the domain name(s) that you intend to use, for example “https://hmi.myserver.com:58725”. Once the certificate is installed properly on the server, check Use SSL and select the installed certificate from the dropdown menu. For detailed instructions, please see read:  Configuring OAS Web Services.  Purchasing and installing an SSL certificate is outside of the scope of the OAS product. For more information on Windows and Certificates, see the following article.

Videos – Siemens

Siemens S7 Connector

Siemens S7 communication driver for S7-200, S7-300, S7-400, S7-1200, and S7-1500.

Getting Started Siemens S7

How to connect to a Siemens S7 controller.

Driver Failover

Communications redundancy with automated failover to backup device or interface.

Videos – Web HMI Dashboard

Web HMI Dashboard

Web HMI Dashboard with no coding required for live and historical visualization, trending, and alarming.

NOTE: The OAS Open UIEngine is a more feature-rich, no-code HMI and application development platform for your automations than the Web HMI Dashboard, which is a basic set of tools for visualization.
See the UIEngine Documentation to learn more.

Open UIEngine

Quick summary of the Open UI Engine – No-code web application and HMI builder.

  • 00:00 – Introduction (New Major Product Feature-Open UI Engine)
  • 00:08 – What is the Open UI Engine?
  • 00:52 – Customizable Project & Screen Structure
  • 01:20 – Rich Component Library
  • 01:51 – Component Properties/OAS Data Driven
  • 02:40 – Settings/Save and Load Projects/Screens
  • 03:01 – Security Options
  • 03:16 – White Label
  • 03:28 – Media Assets
  • 03:47 – Additional Features
  • 04:06 – Learn More

Web HMI Dashboard

Web HMI Dashboard with no coding required for live and historical visualization, trending, and alarming. Persist user sessions with user login. Extend project code to your own custom visualization.

  • 00:00 – Introduction
  • 00:08 – What’s Web HMI Dashboard
  • 00:20 – Features of a WEB HMI Dashboard
  • 00:23 – Secure Login
  • 00:31 – Modular Design
  • 00:37 – Configurable
  • 00:44 – Customizable
  • 00:49 – Lightweight
  • 01:05 – Demo
  • 01:33 – Alarm Dashboard
  • 01:39 – Trend Dashboard
  • 01:55 – Add a Dashboard
  • 02:04 – Add a Module
  • 02:59 – Built-in Modules
  • 03:04 – Numeric Tag Module Configuration
  • 03:59 – Add another numeric tag module / rewrite module
  • 04:53 – Boolean Tag Module
  • 05:00 – Boolean Tag Configuration
  • 05:56 – Display Multiple Tags with real time values
  • 06:04 – Tag Data Module Configuration
  • 07:09 – Alarms Module
  • 07:17 – Alarms Module Configuration
  • 08:21 – Trends Module
  • 08:28 – Configuration
  • 10:28 – Custom Module
  • 10:34 – Configuration
  • 11:16 – Demo Module
  • 11:43 – Getting Started
  • 11:47 – Application Set up
  • 12:00 – Open Service Control
  • 12:58 – Open OAS Configuration App
  • 13:20 – Static Files
  • 13:35 – Configuration
  • 14:46 – Removing a Module
  • 16:25 – Deploying to IIS
  • 18:41 – Conclusion

Videos – Web Trend

Web Trend

Real-time and historical trending for use in Open UI Engine and Web HMI.

Web Trend Coding

View live and historical trend data with open standards library for HTML5, JavaScript, and CSS.

Open UIEngine

Quick summary of the Open UI Engine – No-code web application and HMI builder.

  • 00:00 – Introduction (New Major Product Feature-Open UI Engine)
  • 00:08 – What is the Open UI Engine?
  • 00:52 – Customizable Project & Screen Structure
  • 01:20 – Rich Component Library
  • 01:51 – Component Properties/OAS Data Driven
  • 02:40 – Settings/Save and Load Projects/Screens
  • 03:01 – Security Options
  • 03:16 – White Label
  • 03:28 – Media Assets
  • 03:47 – Additional Features
  • 04:06 – Learn More

Web HMI Dashboard

Web HMI Dashboard with no coding required for live and historical visualization, trending, and alarming. Persist user sessions with user login. Extend project code to your own custom visualization.

  • 00:00 – Introduction
  • 00:08 – What’s Web HMI Dashboard
  • 00:20 – Features of a WEB HMI Dashboard
  • 00:23 – Secure Login
  • 00:31 – Modular Design
  • 00:37 – Configurable
  • 00:44 – Customizable
  • 00:49 – Lightweight
  • 01:05 – Demo
  • 01:33 – Alarm Dashboard
  • 01:39 – Trend Dashboard
  • 01:55 – Add a Dashboard
  • 02:04 – Add a Module
  • 02:59 – Built-in Modules
  • 03:04 – Numeric Tag Module Configuration
  • 03:59 – Add another numeric tag module / rewrite module
  • 04:53 – Boolean Tag Module
  • 05:00 – Boolean Tag Configuration
  • 05:56 – Display Multiple Tags with real time values
  • 06:04 – Tag Data Module Configuration
  • 07:09 – Alarms Module
  • 07:17 – Alarms Module Configuration
  • 08:21 – Trends Module
  • 08:28 – Configuration
  • 10:28 – Custom Module
  • 10:34 – Configuration
  • 11:16 – Demo Module
  • 11:43 – Getting Started
  • 11:47 – Application Set up
  • 12:00 – Open Service Control
  • 12:58 – Open OAS Configuration App
  • 13:20 – Static Files
  • 13:35 – Configuration
  • 14:46 – Removing a Module
  • 16:25 – Deploying to IIS
  • 18:41 – Conclusion

Videos – Azure IoT

Azure IoT Connector

Publish data to Azure Event Hubs and Azure IoT Data Hub.

Azure IoT Data Hub

How to setup communications to Azure IoT Data Hub

  • 0:00 – Introduction
  • 0:17 – Create an IoT Hub
  • 0:47 – Step 1 Azure Portal
  • 0:55 – Step 2 Create a Resource
  • 1:25 – Step 3 Project Details
  • 1:31 – Step 4 Resource Group
  • 1:45 – Step 5 IoT Hub Name
  • 1:54 – Step 6 Review Create
  • 2:03 – Step 7 Deployment is Underway
  • 2:21 – Step 8 Overview
  • 3:18 – Step 9 Shared Access Policies
  • 3:25 – Create an IoT Driver
  • 4:25 – Publish Tags
  • 6:15 – Monitor Values with VS Code
  • 6:38 – Conclusion

IoT Publish

How to publish data to Azure IoT Hub, AWS IoT Gateway, and MQTT Brokers.

  • 00:00 – Introduction
  • 00:23 – Set up Tags in OAS
  • 00:41 – Configure Azure IoT
  • 01:53 – Publish Selected Tags
  • 05:31 – Visual Studio Code
  • 08:00 – Step by step instructions
  • 08:12 – Bulk Publish to AWS IOT
  • 09:21 – Step by step instructions / Publish Data to AWS IOT Gateway
  • 09:33 – Bulk Publish to mqtt broker
  • 10:29 – MQTT Explorer
  • 11:20 – Step by step instructions/ Getting Started MQTT
  • 11:34 – Save button of the OAS Configuration tool

Driver Failover

Communications redundancy with automated failover to backup device or interface.

Videos – AWS IoT

AWS IoT Core

AWS IoT Core communication driver.

IoT Publish

How to publish data to Azure IoT Hub, AWS IoT Gateway, and MQTT Brokers.

Driver Failover

Communications redundancy with automated failover to backup device or interface.

Videos – MQTT

MQTT Connector

Publish data to and receive data from third-party MQTT Brokers.

MQTT Broker

MQTT Broker for OAS data.

MQTT Client

How to connect to third party MQTT Brokers.

OAS MQTT Broker

How to connect to the OAS MQTT Broker for local and remote tag values.

IoT Publish

How to publish data to Azure IoT Hub, AWS IoT Gateway, and MQTT Brokers.

Driver Failover

Communications redundancy with automated failover to backup device or interface.

Videos – OPC UA

OPC UA Connector

Connect to OPC UA Servers for Data Access and Alarms and Conditions.

How to Connect to OPC UA Servers

How to define a Driver Interface and Tags to connect with an OPC UA Server
How to use One Click OPC UA for automated setup.

Driver Failover

Communications redundancy with automated failover to backup device or interface.