odoo_mqtt/iot_bridge/API.md

32 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# IoT Bridge HTTP API
Diese Datei ist eine kurze Orientierung. Die **verbindliche API-Dokumentation** wird durch FastAPI/OpenAPI bereitgestellt.
Base URL: `http://<bridge-host>:8080`
## Source of Truth
- Swagger UI: `http://<bridge-host>:8080/docs`
- ReDoc: `http://<bridge-host>:8080/redoc`
- OpenAPI JSON: `http://<bridge-host>:8080/openapi.json`
Hinweis: Die OpenAPI-Definition wird direkt aus den aktuellen FastAPI-Routen und Pydantic-Modellen erzeugt.
## Authentifizierung
Authentifizierung ist optional. Wenn `BRIDGE_API_TOKEN` gesetzt ist, benötigen geschützte Endpunkte:
```http
Authorization: Bearer <token>
```
Bei fehlendem oder ungültigem Token antwortet die API mit `401` bzw. `403`.
## Wichtigste Endpunkte (Kurzüberblick)
- `GET /health` Health-Status der Bridge.
- `POST /config` Konfiguration von Odoo übernehmen (inkl. MQTT-Reconnect bei Broker-Änderung).
- `GET /config` aktuell aktive Konfiguration zurückgeben.
Für Request-/Response-Schemata und alle Felddetails bitte immer Swagger/ReDoc verwenden.