REST API Server / Retrieving Real-Time Data in REST API Server
In this video of our N3uron Academy, we’re going to explore how to retrieve and modify real-time data using N3uron’s REST API Server module. Let’s get started!
[00:00] Hello everyone, and welcome back! In today’s video, we’re going to explore how to retrieve and modify real-time data using N3uron’s REST API Server module. For this demo, we’ll use Postman as our API testing tool and follow N3uron’s REST API Server documentation to ensure everything is set up correctly. Before we dive in, let’s quickly revisit how we configured the REST API Server in our previous video. We are enforcing HTTPS as the only allowed protocol to ensure secure communication and selecting a specific network interface to prevent the server from listening on every available interface. We’re also using the default port for HTTPS and maintaining the embedded certificates. Next, we’ll look at the access configuration. The Administrator role has full access control, and we’ve also added token-based access with read-only permissions to the tags endpoint.
[01:06] To restrict access to specific areas of the data model, we’ve applied a tag filter that only grants access to the main KPIs of our photovoltaic plant. Let’s now open Postman and head over to the Collection section, where we’ve already prepared a few requests. We’ll begin by retrieving a list of alarms from our N3uron node. To make sure our “List Alarms” request is correctly configured, we’ll cross-check it with the API documentation. We can see that HTTPS is used as the protocol, and the host IP address and port are specified. The request is of type GET and targets the alarm endpoint. The path is set to the root folder so we can retrieve all alarms across the node. The “recurrent” option is enabled, allowing the request to explore all nested subgroups in the tag model. The status filter is set to 3, which, according to the documentation, means we’ll receive only active and unacknowledged alarms.
[02:02] The request uses Basic Authentication with a username and password for the admin user. Once we send the request, the response provides complete alarm details—including the path, description, priority, and status, among other information. After receiving the response, we double-check the result by comparing it with the Alarms Realtime window in the N3uron WebUI, where the same alarms should appear. Now, let’s filter the alarms by priority. We’ll change the priority filter to 4, which means only critical alarms will be returned in the response. As we can see, comparing the response with the Alarms Realtime window, there is only one active and unacknowledged alarm with critical priority.
[03:06] Next, we’ll demonstrate how to acknowledge an alarm using a POST request. According to the API documentation, to acknowledge an alarm, we must send a POST request, and the command for acknowledgment is ‘ack’. The request body is written in JSON format, where we specify the full path of the alarm we want to acknowledge, and optionally, we can include a message with the acknowledgment. We are using Basic Authentication and providing the admin user credentials, which have the necessary GET and POST permissions for the Alarms endpoint in this case. We can see in the Alarm Realtime window that the selected alarm is acknowledged but still active. The user who acknowledged the alarm is registered, and a message is appended to the acknowledgment. Now, let’s move on to reading the real-time value from a specific tag. The read tag is a GET request to the tag endpoint using the read command.
[04:01] By specifying the full path of a tag, we retrieve its current value. When querying a group of tags, additional options are available—such as enabling the recurrent flag and applying regular expression filters to tag paths. We’ll see these options in the next step. In this example, we’re retrieving the value of the Active Energy KPI. For this request, we’re using token-based authentication. That means you’ll need to copy the token created earlier in the REST API Server’s access configuration and paste it into the Authorization header in Postman.
[05:01] After sending the request, we can compare the response with the real-time value displayed in the WebUI. Now, to retrieve data from multiple tags within a group, we’ll use a similar request, but this time we’ll specify a group path that ends with a wildcard and enable the recurrent flag. This allows us to fetch all KPI values within the selected folder and any nested subfolders in the tag model. After sending the request, let’s compare it with the Realtime window in the Web UI for the selected tag group.
[05:01] After sending the request, we can compare the response with the real-time value displayed in the WebUI. Now, to retrieve data from multiple tags within a group, we’ll use a similar request, but this time we’ll specify a group path that ends with a wildcard and enable the recurrent flag. This allows us to fetch all KPI values within the selected folder and any nested subfolders in the tag model. After sending the request, let’s compare it with the Realtime window in the Web UI for the selected tag group.
[06:52] Next, we perform a write operation to update a tag’s value—in this case, updating the Trackers Position for each power station in our photovoltaic plant.
[07:02] We’ll use a POST request with the write command, using Basic Authentication for the admin user. In the request body, we provide the tag’s path and the new value in JSON format. As soon as the write request is sent, the tag updates its value, as shown in the Realtime window in the WebUI. And that wraps up this video. We highly recommend exploring the full API documentation and experimenting with additional endpoints and request configurations to deepen your understanding.
[08:00] In our next video, we’ll cover how to retrieve historical data using the REST API. Thanks for watching, and see you in the next one!
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
DLMS® UA MEMBER
N3uron is a member of the DLMS® User Association, the global community that drives standardization in the energy and water industry. Being part of the DLMS UA represents N3uron's commitment to advancing smart metering and energy management solutions.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
DLMS® UA MEMBER
N3uron is a member of the DLMS® User Association, the global community that drives standardization in the energy and water industry. Being part of the DLMS UA represents N3uron's commitment to advancing smart metering and energy management solutions.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]