CMTK external API access
1. Introduction
This guide shows how to gain external access to the CMTk API.
In principle, all commands that the web server sends and executes can be executed externally (e.g. edge device).
The authentication procedure is the same as that known from BNI.
1.1. Links
Overview of the CMKT API with examples
https://docs.balluff.com/cmtk/2.2.0/dev_guide/api-documentation/01-overview/
2. External API access
The loggin procedure is currently not described in the API documentation.
2.1. Network address
Both addresses set on the CMTk can be used as the network address for the API call:
2.2. Loggin
If you open the developer tool in the browser with F12, you can see the API commands used:
The login data is sent as a JSON object as a payload:
A positive response is answered with the status code 200:
The response also contains the cookie, which must be sent with every further request as authentication:
All other commands are mentioned in the API documentation.
3. Bsp. Thunder Client
Here is a small example of how to log in and control the process data of a Smartlight.
Loggin:

The "jsessionid" cookie is now sent with the header for all requests:

The "devices" command can be used to query the aliases that are required to explicitly request the respective port.
Query process data:

Write process data:

Heir 3 segments are set to the color white:
The parameters of the device can also be read and adjusted. In this example, the modes (index 64 decimal) are changed from chaser to segment:
