API¶
Add MQTT Clients¶
Request¶
POST http://localhost:11395/expert/3.7.0/add_mqtt_clients
Adds or updates MQTT client configurations. Any omitted field will use its default value.
Authentication: None required
Content-Type: application/json
Request Body:
{
"mqtt": {
"clients": {
"my-client-id": {
"host": "127.0.0.1",
"name": "local",
"username": "",
"password": "",
"port": 1883,
"protocol_version": 4,
"keep_alive": 60,
"clean_session": true,
"ssl": false,
"reconnect": {
"enable": true,
"min_delay": 1000,
"max_delay": 60000
}
}
}
}
}
Request Fields:
| Field | Type | Default | Description |
|---|---|---|---|
host | string | localhost | MQTT broker hostname |
name | string | Client display name | |
username | string | "" | Broker username |
password | string | "" | Broker password |
port | integer | 1883 | Broker port |
protocol_version | integer | 4 | MQTT protocol version (3 = MQTT 3.1, 4 = MQTT 3.1.1, 5 = MQTT 5.0) |
keep_alive | integer | 60 | Keep-alive interval in seconds |
clean_session | boolean | true | Start with a clean session |
ssl | boolean | false | Use SSL/TLS |
reconnect.enable | boolean | true | Auto-reconnect on disconnect |
reconnect.min_delay | integer | 1000 | Minimum reconnect delay (ms) |
reconnect.max_delay | integer | 60000 | Maximum reconnect delay (ms) |
Response¶
HTTP Status Codes:
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad request (invalid or missing input) |
500 | Internal error |
Body:
| Field | Type | Description |
|---|---|---|
message | string | "success" on success, or a description of the failure |
Example¶
{
"message": "success"
}
Remove MQTT Client¶
Request¶
POST http://localhost:11395/expert/3.7.0/remove_mqtt_client
Removes one or more MQTT clients by name.
Authentication: None required
Content-Type: application/json
Request Body:
{
"mqtt": {
"clients": [
"local"
]
}
}
Response¶
HTTP Status Codes:
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad request (invalid or missing input) |
Body:
| Field | Type | Description |
|---|---|---|
message | string | "success" on success, or a description of the failure |
Example¶
{
"message": "success"
}