Skip to content

HTTP

HTTP Client

The HTTP Client device allows OnlyView to send HTTP requests to external web servers and APIs for integration with web services, REST APIs, and other HTTP-based systems.

Setup

To configure an HTTP Client device:

  1. Access the Devices section
  2. Click Add Device and select HTTP client
  3. Configure the device settings:
  4. Device name: Enter a descriptive name for this HTTP client
  5. Base URL: The server address (e.g., http://192.168.1.200:8000)
  6. Authentication: Optional HTTP authentication settings
    • Method: Choose "None" or "Basic"
    • Login: Username for Basic authentication
    • Password: Password for Basic authentication

HTTP Messages

The HTTP Client device can send multiple predefined messages, each with its own configuration:

Message Configuration

For each message, configure: - Name: User-friendly name for the message - Endpoint: The specific path to call (e.g., /setStatus) - Method: HTTP method - GET, POST, or PATCH - Output data (POST): Request body data for POST/PATCH requests (e.g., JSON data like {on: "1"})

Response Validation

Each message can optionally validate the server response: - Check result: Enable to validate the response content - Expected result: Text that must be present in the response for success (e.g., {success: "1"})

The device widget in UserScreens will show green when requests succeed (HTTP 200) and the expected response is received (if validation is enabled). Otherwise, it appears red.

Periodic Status Checks

Enable automatic periodic status checks: - Periodically check status: Enable automatic checking - Period: Check interval in seconds (1-3600) - Message to send: Which configured message to use for periodic checks

Actions

The HTTP Client device supports one action type:

Send HTTP Message

Sends one of the configured HTTP messages to the target server.

When creating this action, select which predefined message to send from the dropdown list.

ActionGraph Node

The HTTP Client device includes an ActionGraph node for integration into automation workflows:

HTTP Sender Node

Properties: - Device: Reference to the HTTP Client device configuration

Input Slots: - Endpoint: HTTP endpoint path (string) - Verb: HTTP method like GET, POST, etc. (string) - Body: Request body content (string)

Input Events: - Send request: Triggers the HTTP request

Output Slots: - Error code (200 : OK): HTTP status code from response (integer) - Data: Response body content (string)

Output Events: - Next (immediately after): Fired immediately when request is sent - On success: Fired when request completes successfully (HTTP 200) - On error: Fired when request fails or returns an error status

The node sends an HTTP request using the connected device configuration when the "Send request" input event is triggered. The input slots allow you to dynamically specify the endpoint, HTTP method, and request body, overriding the device's predefined messages.## HTTP Client