๐ API REST
Documentazione + gestione token per integrazioni esterne
(Excel / PowerBI / Business Central / script). Endpoint JSON live a
/api/*. Documentazione interattiva auto-generata a
/docs.
๐ Token API
โ ๏ธ Nessun token impostato โ le API sono libere: chiunque sulla LAN puรฒ chiamarle.
Genera un token per richiedere autenticazione.
๐ Endpoint disponibili
| Metodo | Path | Descrizione | Auth |
|---|---|---|---|
| GET | /api/info | Versione, hostname (health check) | โ |
| GET | /api/commesse | Lista commesse (filtro ?stato=IN_PRODUZIONE&limit=50) | ๐ |
| GET | /api/commesse/<numero> | Dettaglio commessa + tende | ๐ |
| GET | /api/operatori | Lista operatori (basic, no sensibili) | ๐ |
| POST | /api/commesse/verifica | Verifica esistenza/diff (PC reparto) | ๐ |
| POST | /api/commesse/registra | Crea commessa + tende (atomico) | ๐ |
| POST | /api/commesse/aggiorna | Applica modifiche commessa esistente | ๐ |
๐ก Esempi
Curl (PowerShell):
curl http://10.10.10.57:8000/api/commesse
Excel/PowerQuery (M):
let
Source = Json.Document(Web.Contents("http://10.10.10.57:8000/api/commesse"))
in
Source[commesse]
Python (requests):
import requests
r = requests.get("http://10.10.10.57:8000/api/commesse")
print(r.json()["commesse"])
โน๏ธ Documentazione interattiva FastAPI con tutti i parametri: /docs (Swagger UI) o /redoc.