Paessler PRTG offers a brand new Restful API alongside a new UI

 Originally published on December 20, 2021 by Sascha Neumeier
Last updated on April 28, 2022 • 14 minute read

👆 Disclaimer | Please read first

 

Please note that both the new UI and the new API are alpha versions whose development is not yet complete, and offer only a limited set of features. This means that there may still be errors and things may not go as planned.

 

The alpha versions of the new UI and new API currently include the following features:

  • Read: Probes, groups, devices, sensors, and channel data
  • Pause, Resume, Scan: Probes, groups, devices, sensors
  • Acknowledge: Sensors

Check the PRTG Release notes for newly added features.

 

Nevertheless, it is very important for us to share the status with you as soon as possible, because you work with PRTG every day and you deserve to know what's coming.


This gives you the opportunity to influence further development and feature implementation by giving us valuable feedback at an early stage of development. Of course, you can use both the existing and the new UI side by side and easily switch back and forth between them.


A few days ago on the blog, I gave you a sneak peek of the shiny new user interface of Paessler PRTG here on the blog. If you didn't catch it, be sure to check out the article "Paessler PRTG brings an entirely new user experience with a brand new UI". My colleagues can't wait for your feedback on the new interface.

But that's not all. Along with the new UI, a completely new RESTful API is now available in PRTG. In this blog post, I'll show you what exactly this means, what the API is intended for, and what you can do with it. 

PRTG API v2 overview

We have developed the new API v2 in PRTG entirely apart from the previous version, v1. The PRTG API v2 is a so-called RESTful API, which means that it follows the restrictions of the REST architecture and enables interactions with all RESTful web services.

The API is based on the OpenAPI Specification, a standard for describing REST-compliant programming interfaces. Our main goal with the new API is to enable you to easily automate your monitoring and to integrate with other tools.

quickstart-apiversion

Reflecting this basis, our API v2 reference is also fully documented in the Swagger software framework.

Alright, that's it for the theory!

Activate the new UI and new API (Alpha)

Before I show you what new features the UI brings, let's take a look at how you can activate the new interface. Three steps are necessary to do this:

  • Open the setup settings of PRTG and select Setup | Overview
  • Find the Activate New UI And New API (Alpha) option on the bottom-right and click Activate.
  • Enable the check box to confirm that you have read the disclaimer and click OK to activate the new UI and new API (Alpha).

Make sure that port 8443 (HTTPS) or port 8080 (HTTP) and port 23580 (HTTPS and HTTP) are free.

After the PRTG application server has installed and the PRTG core server has restarted, you can use the Open new UI button in the top-right corner to open the new UI. Alternatively, enter the relevant URL: http(s)://<yourprtgserver>:Port

Use port 8443 for secured connections or port 8080 if you want to access the web UI with an unsecured connection.

Using the new PRTG API v2

Wait a second: If dealing with APIs is your daily business, and you don't need examples because you're already sitting impatiently in front of your PowerShell prompt, then just turn straight to the documentation and get started right now.

🔥 PRTG API v2 overview | How to use the API and what to expect from it

🔥 PRTG API v2 reference | API reference documentation for the PRTG API v2


Otherwise, let's continue with a few examples that show you what this API is capable of.

Some examples how to use the API

First of all, log in to the new UI if you haven’t already. On the start page with the cards find the PRTG API v2 card and click on the text link "different endpoints".

api-v2-card-overview

From here you can discover every single endpoint that we currently offer. A good first step is to perform a login. Select Authentication, the “POST /session” and click the “Try it out” button at the top right. Enter the credentials for your PRTG instance in the request body and hit “Execute”. 

Note: Our developers are currently preparing an API key function for authorization. This feature will be available to you shortly.

Now you should see that the lock at the top right, where it says “Authorize”, is now locked. This means that you can use the “try it out” button for every single endpoint that you can find here.

api-v2-authentication

Another good example is to get a list of all available devices. To do that, expand “GET /devices”. Here you can see which URL parameters you can use to filter and sort your results. Below that it will show you what a request should look like and what to expect in the response body.

By clicking the “Try it out” button you get the actual server response with a list of all your devices that you have access to with your current user credentials.

api-v2-devices

An example of an action that is sent to PRTG via the API is pausing a device. Navigate to the Pause endpoint and select "Try it out" again.

There you enter the ID of the device to be paused and start the action by clicking on "Execute". The response code will show you if the request was successful or not.

api-v2-devices-pause

Since pictures are worth a thousand words, be sure to check out the tutorial video with my colleague Nina. She shows you how to activate the new features and how you can work with the API using various examples.

What you can expect in the future

Just as with PRTG's fancy new UI, the new PRTG API v2 is just beginning its journey. From the very beginning, it was important for us to provide you an early insight into the development of the new features and incorporate your feedback into the ongoing development.

Every day, our developers passionately work to evolve the new API so that you can use it for your daily work as much as possible. Currently, they are busy making sure that you are able to create and edit monitoring objects using the API as well as to use an API key.
To stay on top of the game, don’t forget to regularly look at our PRTG release notes page.

Helpful resources around the new UI and API

👉 KB Article: I want to use the new UI and new API. What do I need to know?

👉 PRTG Video Tutorial: New Interface (Alpha Version)

👉 Blog: PRTG v. 21.4.73 comes with a new user interface, API and a new probe

👉 Blog: Paessler PRTG brings an entirely new user experience with a brand new UI

We want to know if you like it

If you have any questions, requests or suggestions regarding the new API, don't hesitate to contact us by e-mail at roadmap@paessler.com or support@paessler.com or just leave a comment below.