Industrial use of REST APIs - 5 practical examples

With the help of REST (Representational State Transfer), (web) services, devices and other systems can be addressed in a targeted manner. Using a predefined interface, the so-called REST API, selected information (resources) is made available by these systems.

This data can then be accessed and received by a client in various formats (including HTML, XML and JSON). The available output formats and the addressable resources are defined by the interface provider.

A REST API is usually accessed via HTTP or HTTPS. Authentication is possible in multiple ways. The main characteristics of the REST architecture are its simple implementation, security and scalability – factors that make it ideally suited for data exchange between different systems in an industrial environment.

In this post we will take an in-depth look at five use cases to show how data can be collected and distributed via REST API in various industries:

You can find more detailed information about the REST architecture here: „What is REST? Use in industry

1. Connecting Sartorius laboratory balances

Sartorius is a company that produces premium balances for use in laboratory environments.

A laboratory balance such as the Cubis® II not only offers a wide range of configuration options for recording accurate laboratory data, but also supports extensive data integration. The latter makes it possible to integrate the balance with your laboratory information management system (LIMS) to ensure the integrity of results and optimize workflows.

Accurate recording, storage and allocation of data are not only essential in scientific and industrial environments, but in many cases also required by law.

With the OPC Router, measured values, environmental information such as temperature, air pressure and humidity, or the display indication can be retrieved via GET request using the REST API of the laboratory balance and then stored in a database. This is realized via the REST Plug-in of the OPC router.

Likewise, the balance can be controlled using its REST API. Possible actions include the calibration of the balance or the opening and closing of the draftshield mechanism.

Let your systems talk to each other via REST

Test the OPC Router with the REST Plug-in now, free of charge and without obligation.

2. Exchanging data with the Ewon Flexy 205 via the Talk2M Cloud

The Ewon Flexy 205 Remote Maintenance Router combines the data it gathers from connected system within the Talk2M Cloud. In addition to the possibility of remote controlling machines, it thus also provides extensive plant data for evaluation and analysis.

Communication between the OPC Router and the Ewon Flexy 205 via the Talk2M Cloud

Other systems can access the data gathered by the Ewon Flexy 205 via a REST API. For example, the OPC Router can be connected to the Talk2M Cloud using the REST Plug-in.

Data can then be written to the cloud and data can be transferred from the cloud to databases. Furthermore, the OPC Router allows you to select a time range to retrieve the related data specifically.

In our tutorial on how to address the Ewon HMS Flexy 205 via the Talk2M Cloud you will learn in detail how to configure the corresponding connections in the OPC Router to enable data exchange as described above.

3. Controlling a Zebra label printer

The OPC Router can not only retrieve data from other applications via a REST API, but can also be used to implement a REST API for a connected device.

In this way, a Zebra label printer can be integrated into the production system. After it has been connected to the OPC Router via the Zebra Plug-in, print jobs can be transmitted to the OPC Router and subsequently to the Zebra label printer via REST request. This is made possible by the OPC Router’s REST Plug-in.

The printer thus becomes part of your infrastructure as well as the IoT (Internet of Things) and can be addressed at any time through the connection to the OPC Router. At the same time, errors during labeling are avoided.

OPC Router Zebra Plug-in

To ensure a smooth integration, our site provides you with detailed information on how to connect a Zebra printer with the OPC Router.

Test the OPC Router now

Test the OPC Router with the REST and Zebra Plug-ins now, free of charge and without obligation.

4. Retrieving current weather data via the OpenWeatherMap API

One example for the use of a REST API is the retrieval of current weather data and the subsequent integration of this data into your own applications.

Retrieving and processing weather data with the OPC Router via the OpenWeatherMap REST API

The online service OpenWeatherMap makes its shorter-term forecasts available free of charge. An API key can be requested at https://home.openweathermap.org/users/sign_up. The access options are defined in the API documentation at https://openweathermap.org/api.

The OPC Router can retrieve this data as a REST client using the REST Plug-in and further process, store and integrate it into its own applications.

To retrieve the current weather data for a specific city, the OPC Router first makes a REST request to the appropriate API endpoint, in this case „weather“.

The request contains the required parameters, in this case a city ID and the app ID for identification. In response, a JSON document containing the requested weather data is transferred. Using a JSON transfer object, the required information (e.g., temperature and humidity) can be specifically transferred to other systems for further processing.

The instructions for retrieving weather data with the REST Plug-in show in detail how the data retrieval described above can be performed with the OPC Router. It also explains how the retrieved data can be stored in an SQL database and then sent to selected users via a Telegram bot.

5. Retrieval of data from the Proficy Historian database by other systems

The Proficy Historian database software by the U.S.-based company General Electric can store enterprise-wide process and production data from numerous sources, including programmable logic controllers (PLCs) and HMI/SCADA systems.

This data can then be made available for other systems to retrieve. One way to redistribute production data via Proficy Historian is through the database software’s REST API.

The OPC Router can retrieve the desired information from the Proficy Historian database using the REST Plug-in.

The solution described above offers numerous benefits to an organization: By bringing together, archiving, managing and selectively processing data from a wide variety of systems, a high level of transparency, control and security can be realized. In addition to this, the stored data can be used to uncover further optimization potential.

Furthermore, the solution is highly scalable and cloud-compatible. Proficy Historian’s compression features allow large amounts of data to be stored over a long period of time.

Test the OPC Router now

Test the OPC Router with the REST Plug-in now, free of charge and without obligation.

More information

Find more exciting topics here:

REST Plug-in

The OPC Router enables a smooth and secure communication via REST. With the help of its REST Plug-in, the OPC Router is not only able to address other systems through their REST API but can also be used to implement a REST API for a connected system using REST triggers. For more information about the implementation and use of REST technology in an industrial environment, please refer to our page about the REST Plug-in.

Microsoft Teams

Using a REST API, the OPC Router can send messages to Microsoft Teams. This way, the functionality of the popular Microsoft application can be easily integrated into your own production system. You can find out how this works in detail by referring to our instructions for connecting Microsoft Teams via REST.

What is the OPC Router?

The OPC Router is a software that networks your machines and systems. It enables the connection of all existing systems and can modernize processes sustainably. Our video explains exactly how the OPC Router works, how it can be integrated into your system environment and what advantages it offers your company.