Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Authentication

For each request, authentication data must be sent. For the TreeApi, two kinds of authentication are possible: basic authentication and JWT authentication.

Basic authentication

If basic authentication is used, the user name and password must be encoded in the basic authentication header field of the HTTP request. This must be done for each request.

JWT authentication

JWT config options can be set in xio.TreeApi.cfg
A Bearer token can be retrieved via POST /security/createToken
Body:

...

A new token can be retrieved by providing a valid token to GET /security/refresh

Request and response

...

format

Request bodies must be encoded as JSON data. In addition it is required to send the correct HTTP content header field:

...

All response bodies are encoded as JSON data too.

Services for reading and writing items

Read Item

Retrieve single item values.

...

Code Block
[
    {
        "itemId": "NETx\\Virtual\\Floor1\\Meter01\\Total Energy",
        "result": "success"
    },
    {
        "itemId": "NETx\\Virtual\\Floor1\\Meter01\\Total Energy",
        "result": "success"
    },
	{
        "itemId": "NETx\\Virtual\\Floor1\\Meter02\\Total Energy",
        "result": "success"
    },
	{
        "itemId": "NETx\\Virtual\\Floor1\\Meter02\\Volts",
        "result": "success"
    }
]

Listen for item value changes

Make sure to include the 'Authorization' header based on your chosen settings.

...