{"wiki":"en","slug":"guide-system-html-sse","markdown":"# Using the HTML API and SSE\n\nThis setup guide describes how to set up and use the HTML API and SSE of the BEHNKE STATION.\n\nThe Behnke Station provides two interfaces for network access with the \n\n**HTML API** and **Server-Sent Events (SSE)**. The **HTML API** can be used to query and change settings of the Behnke Station and to trigger certain events. Communication takes place via HTTP or HTTPS requests.\n\n**Server-Sent Events (SSE)**, on the other hand, enable a permanent connection between a client and the Behnke Station. Over this connection, the station can transmit events that occur, for example detected key presses, immediately to the connected client.\n\nBoth interfaces are disabled by default and must be explicitly enabled before use. The **administrator password** is required for access.\n\n%[NOTE_REQUIRES_BASIC_SETUP](NOTE_REQUIRES_BASIC_SETUP)%\n\n\n> [!TIP]\n> All built-in tools in this wiki article work ONLY with **HTTPS**. Before you can use these tools, you must visit the device's web interface with this end device and accept the certificate warning.\n\n<!-- block: html-api-und-sse-aktivieren -->\n## 1. Enable the HTML API and SSE\n\n%[BS_LOGIN_INFO](BS_LOGIN_INFO)%\n\n- In the sidebar on the left, click the menu item %BS_MENU_SYSTEM%\n- Navigate to the **API** section\n\n![Web interface, **API** section](uploads/9587b59454a9c2751ac6e10e65f202f2/grafik.png)\n\n- Set the value of the option **Access to HTML API** to **allow**\n- Set the value of the option **Access to SSE** to **allow**\n- Click %BS_MENU_SPEICHERN_ROT% to save the configuration\n\n<!-- block: html-api-verwenden -->\n## 2. Using the HTML API\n\nThe HTML API makes it possible to call functions of the Behnke Station via HTTP or HTTPS requests. Depending on the API command used, information can be queried, settings can be changed or actions can be triggered.\n\n> [!NOTE]\n> Use of the HTML API must first be allowed in the configuration of the Behnke Station. See 1.\n\nThe general scheme of an API call is:\n\n```text\nhttps://[IP-Adresse]/?key=[Administrator-Passwort]&api=[Befehl]\n```\n\nThe following information is required:\n\n- **[IP-Adresse]**: IP address of the Behnke Station\n- **[Administrator-Passwort]**: administrator password of the Behnke Station\n- **[Befehl]**: API command to be executed\n- if applicable, further parameters of the respective command\n\n> [!IMPORTANT]\n> If the administrator password contains special characters, they must be **URL-encoded** accordingly for use within the URL.\n\n<!-- block: api-befehl-erstellen -->\n### 2.1 Creating an API command\n\nThe integrated API Command Builder can be used to create a valid API call.\n\n%BS_API_COMMAND_BUILDER%\n\nThe API Command Builder helps you assemble the command and the required parameters.\n\n<!-- block: api-aufruf-testen -->\n### 2.2 Testing an API call\n\nThe integrated API Tester can be used to test an API call.\n\n%BS_API_TESTER%\n\nAlternatively, an API call can be executed directly via a web browser or another HTTP client.\n\nExample of calling the API help:\n\n```text\nhttps://[IP-Adresse]/?key=[Administrator-Passwort]&api=help\n```\n\nThe `help` command can be used to retrieve further information about the available API commands.\n\n> [!TIP]\n> Whenever possible, always use **HTTPS** so that the administrator password and other transmitted data are sent encrypted.\n\n# 3. Using Server-Sent Events (SSE)\n\nWith Server-Sent Events, a permanent connection can be established between a client and the Behnke Station.\n\nAfter the connection is established, it stays open. The Behnke Station can use it to transmit events that occur immediately to the connected client. These may include, for example, detected key presses or other events of the station.\n\n> [!NOTE]\n> Use of SSE must first be allowed in the configuration of the Behnke Station.\n\nThe administrator password is required to establish the connection.\n\nThe connection can be established via HTTP or HTTPS:\n\n```text\nhttp://[IP-Adresse]:8080/?key=[Administrator-Passwort]&sse\n```\n\nor:\n\n```text\nhttps://[IP-Adresse]:8443/?key=[Administrator-Passwort]&sse\n```\n\n> [!IMPORTANT]\n> If the administrator password contains special characters, they must be **URL-encoded** accordingly for use within the URL.\n\n<!-- block: sse-verbindung-testen -->\n### 3.1 Testing the SSE connection\n\nThe integrated SSE Tester can be used to test the SSE interface.\n\n%BS_SSE_TEST%\n\nAfter the connection has been established successfully, events transmitted by the Behnke Station are displayed in the tester.\n\n> [!TIP]\n> Whenever possible, use the encrypted connection via **HTTPS on port 8443**.\n\n<!-- block: http-und-https -->\n## 4. HTTP and HTTPS\n\n**HTTPS** should always be used for the HTML API and SSE. This way, the administrator password and other transmitted information are sent encrypted.\n\nHTTP connections are only possible if they have been explicitly allowed via the **Web connections** setting in the **General** section.\n\n| Interface | HTTP | HTTPS |\n|---|---|---|\n| HTML API | `http://[IP-Adresse]/?...` | `https://[IP-Adresse]/?...` |\n| SSE | `http://[IP-Adresse]:8080/?...` | `https://[IP-Adresse]:8443/?...` |\n\n<!-- block: besonderheit-bei-verwendung-eines-webcam-vlans -->\n## 5. Special case when using a webcam VLAN\n\nFor the HTML API, the IP address of the Behnke Station is always used.\n\nSSE has a special case: if a separate VLAN for the webcam is configured in the **Network** section, the IP address of the webcam must be used for the SSE connection.\n\n<!-- block: faq -->\n## FAQ \n\n%[NO_CONTENT](NO_CONTENT)%\n","lastModified":"2026-10-14T13:47:15+02:00"}