> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# High Byte Config

> Client-mode REST API connectors for HighByte Intelligence Hub: read connection inputs and modeled instances, write MQTT values to hub outputs and call API-trigger pipelines through the REST Data Server, and check hub info, connection health and project export / merge through the Configuration API

Technical Preview

## Overview

Client-mode REST API connectors for HighByte Intelligence Hub: read connection inputs and modeled instances, write MQTT values to hub outputs and call API-trigger pipelines through the REST Data Server, and check hub info, connection health and project export / merge through the Configuration API.

This is one of the templates in the HighByte Intelligence Hub REST API app (`highbyte-intelligence-hub`). Deploy it alongside the other connectors of that app when they depend on each other (for example a token connector plus an API connector).

## Auth

Auth headers used by the template: `Authorization: {value.json.authorization}`.

## Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the High Byte Config connector | no |
| `BaseUrl` | string | High Byte Config base URL without trailing slash (e.g. http\://YOUR\_HIGHBYTE\_HOST:45245) | yes |

`BASE_ADDRESS` default: `http://YOUR_HIGHBYTE_HOST:45245`.

## Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `GetInfo` | GET | `/v1/info` | `historian/highbyte-config/info/get` | `historian/highbyte-config/info/get/response` | none |
| `Login` | POST | `/login` | `historian/highbyte-config/session/create` | `historian/highbyte-config/session/create/response` | `body` |
| `ExportProject` | GET | `/v1/project/export` | `historian/highbyte-config/project/export` | `historian/highbyte-config/project/export/response` | `authorization` |
| `ImportPartialProject` | POST | `/v1/project/partial/import` | `historian/highbyte-config/project/merge` | `historian/highbyte-config/project/merge/response` | `authorization`, `body` |
| `GetConfigSchema` | GET | `/v2/schemas/{value.json.schema}` | `historian/highbyte-config/schema/get` | `historian/highbyte-config/schema/get/response` | `schema` |
| `GetConnectionStatus` | GET | `/v1/connection/status` | `historian/highbyte-config/connection-status/list` | `historian/highbyte-config/connection-status/list/response` | `authorization` |

## Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode HIGH_BYTE_CONFIG"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE HighByteConfig WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "http://YOUR_HIGHBYTE_HOST:45245"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "false"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT GetInfo
        WITH SOURCE_TOPIC "historian/highbyte-config/info/get"
        WITH DESTINATION_TOPIC "historian/highbyte-config/info/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/v1/info"
        WITH HEADERS
            ADD "Accept" "application/json"
    ADD EVENT Login
        WITH SOURCE_TOPIC "historian/highbyte-config/session/create"
        WITH DESTINATION_TOPIC "historian/highbyte-config/session/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/login"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
        WITH BODY "{value.json.body}"
    ADD EVENT ExportProject
        WITH SOURCE_TOPIC "historian/highbyte-config/project/export"
        WITH DESTINATION_TOPIC "historian/highbyte-config/project/export/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/v1/project/export"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
    ADD EVENT ImportPartialProject
        WITH SOURCE_TOPIC "historian/highbyte-config/project/merge"
        WITH DESTINATION_TOPIC "historian/highbyte-config/project/merge/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/v1/project/partial/import"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "{value.json.authorization}"
        WITH BODY "{value.json.body}"
    ADD EVENT GetConfigSchema
        WITH SOURCE_TOPIC "historian/highbyte-config/schema/get"
        WITH DESTINATION_TOPIC "historian/highbyte-config/schema/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/v2/schemas/{value.json.schema}"
        WITH HEADERS
            ADD "Accept" "application/json"
    ADD EVENT GetConnectionStatus
        WITH SOURCE_TOPIC "historian/highbyte-config/connection-status/list"
        WITH DESTINATION_TOPIC "historian/highbyte-config/connection-status/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/v1/connection/status"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "{value.json.authorization}"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

## Usage example

Call `GetInfo` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'historian/highbyte-config/info/get/response' &
mosquitto_pub -t 'historian/highbyte-config/info/get' -m '{}'
```

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API Apps catalog](/latest/lot-language/routes/rest-api-apps)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.