API Documentation

This page explain how you can configure and send API request to read data from the ObX Historian Server.

Pre-Requisites

  1. The ObX Historian Server has API License.

    You can check if you have API license using ObX Admin Tools, from the Main page, click on the Check License Info

    Click on the Check License info

    This will open a License Viewer dialog in which you can see all list of features license to you ObX Historian Server. Make sure the API license is checked, it means you have API license.

  1. Create an API User

Open ObX Admin Tools and from the left pane Go to -> Users -> API

Right-click on the API -> Add User , this will open a new window for creating a User in the ObX historian.

Add User Window

Fill in all the fields:

Username (required) - the username used by the 3rd party software to connect.

Password (required) - the password used by the 3rd party software to connect.

Confirm (required) - for password confirmation.

Description (optional)

Grant - Check this where you want to give this API user an access to specific datasource.

Privilege - Select what type of privilege this API user will have to specific datasource, for example READ - for read only, WRITE - for write only, ALL - for both read and write.

Sample configuration

Click on CREATE button to finish.

API Configuration

circle-info

The API uses basic authentication, which uses a username and password created in the ObX Admin Tools.

API Endpoint


IP Address - the IP address where the ObX WebUI component is installed. It could also be a valid FQDN e.g. www.domain.com

Query Paremeters

  • q : The query (SQL like) to fetch data in the ObX Historian.

  • db: The datasource name in the ObX Historian.

Example Using Postman

Postman Settings

URL:

Query Parameters:

Query Parameters
Value

q

SELECT mean("value") FROM "Counter" WHERE time >=now()-1h GROUP BY time(1m)

db

Energy

Authentication:

circle-info

Note that in Authentication, you have to use the Basic Auth and use the credentials created in the ObX Admin Tools.

Output Response:

The output response is in JSON format.

circle-info

Notice the timestamp format is in ISO806.

You can also simply use a web browser and type in directly into URL

circle-exclamation

Example Using NodeJS

Using axios library (but you can use any libraries)

Last updated