Esempio rapidoQuick example
curl "http:///api/info"
curl -X POST "http:///api/app/music?action=open"
curl -X POST "http:///api/face/expr?name=Happy"
curl -X POST "http:///api/screen?on=false"
La superficie HTTP del robot: stato, configurazione, rete, apps, viso, voce, notifiche, media e file. Il firmware registra 115 route; molteplici metodi sullo stesso percorso contano come registrazioni separate. The robot's HTTP surface: status, configuration, network, apps, face, voice, notifications, media, and files. The firmware registers 115 routes; multiple methods on the same path count as separate registrations.
Prima di usare un endpoint: URL base, metodo, formato del corpo e codici di risposta.Before using an endpoint: base URL, method, body format, and response codes.
Il server web è attivo solo quando il robot è connesso al Wi-Fi e non si trova in modalità BLE-only. Le richieste sono servite una alla volta e la risposta chiude la connessione. Il formato generale è JSON; fanno eccezione la pagina web e i suoi asset, il framebuffer BMP, la copertina audio e l'esportazione CSV delle statistiche.The web server is active only when the robot is connected to Wi-Fi and is not in BLE-only mode. Requests are served one at a time and the response closes the connection. The general format is JSON; exceptions are the web page and its assets, the BMP framebuffer, the audio cover, and the CSV statistics export.
Un POST con corpo JSON richiede al firmware di attendere il body e può impiegare circa dieci secondi. Quando il route accetta parametri di query, è preferibile usarli: vengono letti subito dopo le intestazioni. Gli errori applicativi usano {"ok": false, "error": "…"} con codici 400, 404, 409, 410, 415, 500 o 503.A POST with a JSON body requires the firmware to wait for the body and can take about ten seconds. When a route accepts query parameters, prefer them: they are read immediately after the headers. Application errors use {"ok": false, "error": "…"} with codes 400, 404, 409, 410, 415, 500, or 503.
POST /api/config non accette più scritture e risponde 410 Gone: la configurazione vive in quattro file JSON sulla scheda SD. Le API di rete, volume, luminosità e notifiche sono invece ancora attive.POST /api/config no longer accepts writes and answers 410 Gone: configuration lives in four JSON files on the SD card. Network, volume, brightness, and notification APIs are still active.
| CodiceCode | SignificatoMeaning |
|---|---|
| 200 | Operazione riuscitaOperation succeeded |
| 400 | Richiesta malformataMalformed request |
| 404 | Risorsa assenteResource not found |
| 409 | Stato incompatibileConflicting state |
| 410 | Endpoint deprecatoDeprecated endpoint |
| 415 | Tipo di contenuto non supportatoUnsupported content type |
| 500 | Errore internoInternal error |
| 503 | Servizio non prontoService not ready |
curl "http:///api/info"
curl -X POST "http:///api/app/music?action=open"
curl -X POST "http:///api/face/expr?name=Happy"
curl -X POST "http:///api/screen?on=false"
/api/input/tap sono in unità del viso (x 0..128, y −44.9..111), non pixel./api/input/tap coordinates are face units (x 0..128, y −44.9..111), not pixels.Ogni voce è tratta dal router del firmware; i metodi sono indicati esplicitamente.Every entry comes from the firmware router; methods are listed explicitly.
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | / | Pagina principale della web UI.Main web-UI page. |
| GET | /control | Vista ridotta del vetro con comandi remoti.Reduced glass view with remote commands. |
| GET | /faces | Reindirizza alla sezione Brain (HTTP 302).Redirects to the Brain section (HTTP 302). |
| GET | /app/* | Asset statici compilati nel firmware: CSS, JS, tab, grafici.Static assets compiled into firmware: CSS, JS, tabs, charts. |
| GET | /api/info | Stato dispositivo: uptime, heap, RSSI, IP, SD, IMU, batteria, ora.Device status: uptime, heap, RSSI, IP, SD, IMU, battery, time. |
| GET | /api/version | Versione e metadati di build del firmware.Firmware version and build metadata. |
| GET | /api/serial | Log seriale degli eventi, filtrabile per timestamp.Event serial log, filterable by timestamp. |
| GET | /api/perf | Metriche di prestazioni e tempi di ciclo.Performance metrics and cycle timings. |
| GET | /api/stats | Sommario metriche, eventi principali e attività recente.Metric summary, top events, and recent activity. |
| GET | /api/stats/export | Storico completo in formato CSV.Full history in CSV format. |
| GET | /api/power | Potenza della sessione: batteria e consumo corrente.Session power: battery level and current draw. |
| GET | /api/pmu | Lettura dettagliata del PMU AXP2101.Detailed AXP2101 PMU reading. |
| GET | /api/diag | Diagnostica coordinata di display, touch, microfono e codec.Coordinated display, touch, microphone, and codec diagnostics. |
| GET | /api/config | Configurazione corrente (sola lettura).Current configuration (read-only). |
| POST | /api/config | Non più supportato: risponde 410 Gone. Usare i file JSON sulla SD.No longer supported: answers 410 Gone. Use the JSON files on the SD card. |
| GET | /api/settings | Impostazioni correnti: volume, luminosità, lingue, notifiche, Wi-Fi.Current settings: volume, brightness, languages, notifications, Wi-Fi. |
| POST | /api/settings | Salva e applica subito le impostazioni.Saves and immediately applies settings. |
| POST | /api/levels | Imposta volume, luminosità e volume MP3.Sets volume, brightness, and MP3 volume. |
| POST | /api/screen | Accende o spegne il display.Turns the display on or off. |
| GET | /api/screen.bmp | Framebuffer RGB565 368×448 (circa 495 KB).368×448 RGB565 framebuffer (about 495 KB). |
| GET | /api/screen.vlq | Fotogramma ridotto 92×112 per la vista /control.Reduced 92×112 frame for the /control view. |
| POST | /api/reboot | Riavvia il robot.Reboots the robot. |
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | /api/net | Stato della connessione Wi-Fi corrente.Current Wi-Fi connection state. |
| GET | /api/net/retry | Rilancia il tentativo di connessione.Retries the connection attempt. |
| POST | /api/net/retry | Rilancia il tentativo di connessione.Retries the connection attempt. |
| GET | /api/net/forget | Dimentica una rete salvata.Forgets a saved network. |
| POST | /api/net/forget | Dimentica una rete salvata.Forgets a saved network. |
| GET | /api/wifi/scan | Reti trovate dalla scansione in corso.Networks found by the running scan. |
| POST | /api/wifi/scan | Avvia la scansione delle reti vicine.Starts scanning nearby networks. |
| GET | /api/wifi/saved | Reti salvate nel dispositivo.Networks saved on the device. |
| POST | /api/wifi/save | Salva le credenziali di una rete.Saves a network's credentials. |
| POST | /api/wifi/connect | Salva e connette a una rete.Saves and connects to a network. |
| POST | /api/wifi/use | Connette a una rete già salvata.Connects to an already saved network. |
| POST | /api/wifi/forget | Rimuove una rete dall'elenco salvato.Removes a network from the saved list. |
| GET | /api/ble | Stato BLE: heap, MAC e dispositivi rilevati.BLE state: heap, MAC, and detected devices. |
| POST | /api/ble/toggle | Attiva o disattiva la radio BLE a runtime.Enables or disables the BLE radio at runtime. |
| GET | /api/ble/scan | Risultati della scansione BLE.BLE scan results. |
| POST | /api/ble/scan | Avvia una scansione BLE di cinque secondi.Starts a five-second BLE scan. |
| GET | /api/ble/inspect | Servizi GATT di un dispositivo.GATT services of a device. |
| POST | /api/ble/inspect | Esplora i servizi GATT di un dispositivo.Inspects a device's GATT services. |
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | /api/apps | Catalogo delle app registrate.Catalogue of registered apps. |
| GET | /api/app | Alias del catalogo delle app.Alias of the app catalogue. |
| GET | /api/app/ | Stato dell'app richiesta: stato, errore, dettaglio.State of the requested app: state, error, detail. |
| POST | /api/app/ | Apre l'app sul vetro. Sono accettati anche cmd e key, o un POST vuoto.Opens the app on the glass. cmd and key are also accepted, as is an empty POST. |
| POST | /api/app/ | Chiude l'app e torna al launcher (back e home sono equivalenti).Closes the app and returns to the launcher (back and home are equivalent). |
| POST | /api/app/ | Esegue un comando o una chiave sull'app attiva; arg ripete un'azione iterativa.Runs a command or key on the active app; arg repeats an iterative action. |
| POST | /api/input/tap | Simula un tocco. Le coordinate sono in unità del viso: x 0..128, y −44.9..111.Simulates a tap. Coordinates are face units: x 0..128, y −44.9..111. |
| GET | /api/input/tap | Simula un tocco (stessa semantica del POST).Simulates a tap (same semantics as POST). |
| POST | /api/input/button | Simula un pulsante laterale: boot/pwr, short/long.Simulates a side button: boot/pwr, short/long. |
| GET | /api/input/button | Simula un pulsante laterale (stessa semantica del POST).Simulates a side button (same semantics as POST). |
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | /api/face/state | Espressione corrente, atto in scena e stato generale.Current expression, active act, and overall state. |
| GET | /api/face/exprs | Catalogo completo delle 56 espressioni.Full catalogue of the 56 expressions. |
| GET | /api/face/graph | Grafo delle transizioni tra espressioni.Expression transition graph. |
| GET | /api/face/acts | Elenco dei 49 atti disponibili.List of the 49 available acts. |
| GET | /api/face/live | Fotogramma corrente del vetro in formato ridotto.Current glass frame in reduced format. |
| GET | /api/face/expr?name= | Forza un'espressione specifica.Forces a specific expression. |
| POST | /api/face/expr?name= | Forza un'espressione specifica.Forces a specific expression. |
| GET | /api/face/act?name= | Esegue un atto animato.Runs an animated act. |
| POST | /api/face/act?name= | Esegue un atto animato.Runs an animated act. |
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | /api/chat | Invia un messaggio testuale all'assistente attivo.Sends a text message to the active assistant. |
| POST | /api/chat | Invia un messaggio testuale all'assistente attivo.Sends a text message to the active assistant. |
| GET | /api/chat/status | Stato della chat: occupato, ultima risposta, errori.Chat status: busy, last reply, errors. |
| GET | /api/chat/profile | Profilo attivo e parametri della chat.Active profile and chat parameters. |
| GET | /api/voice/status | Stato della sessione vocale: off, connecting, listening, speaking.Voice session state: off, connecting, listening, speaking. |
| GET | /api/voice/tts | Genera e riproduce la voce con il motore configurato.Generates and plays speech with the configured engine. |
| POST | /api/voice/tts | Genera e riproduce la voce con il motore configurato.Generates and plays speech with the configured engine. |
| GET | /api/voice/stt | Registra quattro secondi e trascrive l'audio.Records four seconds and transcribes the audio. |
| POST | /api/voice/stt | Registra quattro secondi e trascrive l'audio.Records four seconds and transcribes the audio. |
| GET | /api/assistant | Configurazione degli assistenti.Assistant configuration. |
| POST | /api/assistant | Salva la configurazione degli assistenti.Saves assistant configuration. |
| POST | /api/assistant/verify | Verifica la raggiungibilità di un endpoint LLM.Verifies the reachability of an LLM endpoint. |
| POST | /api/assistant/models | Elenco dei modelli disponibili su un endpoint.List of models available on an endpoint. |
| POST | /api/assistant/voicebox | Gestione dei profili vocali Voicebox.Voicebox voice-profile management. |
| GET | /api/assistant/discover | I server voce trovati con mDNS e l'errore dell'ultima ricerca.The voice servers found through mDNS and the error of the last search. |
| POST | /api/assistant/discover | Forza una ricerca mDNS dei server voce.Forces an mDNS search for the voice servers. |
| POST | /api/assistant/start | Avvia l'attività dell'assistente.Starts the assistant activity. |
| POST | /api/assistant/stop | Arresta l'attività dell'assistente.Stops the assistant activity. |
http://:17500 e la chiave API vuota. La procedura è in docs/10-Sintesi-vocale-locale.md.
these routes talk to the server set in the profile URL. A self-hosted server such as AiLocalVoiceServer (C#/.NET 10, OpenAI-compatible and Voicebox-compatible APIs, runnable on Android too) exposes the same routes and makes the voice chain offline and free of paid services: the robot needs no change, only the URL http://:17500 and an empty API key. The procedure is in docs/10-Sintesi-vocale-locale.md.
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| POST | /api/notify | Invia una notifica: testo, TTS o audio WAV, con priorità e opzioni di interazione.Sends a notification: text, TTS, or WAV audio, with priority and interaction options. |
| GET | /api/notify | Messaggio attivo, coda, contatori ed eventuale risposta sì/no.Active message, queue, counters, and any yes/no response. |
| DELETE | /api/notify | Svuota completamente la coda dei messaggi.Clears the message queue completely. |
| POST | /api/notify/cancel | Annulla il messaggio corrente e ferma audio e digitazione.Cancels the current message and stops audio and typing. |
| POST | /api/notify/respond | Risponde a una notifica interattiva sì/no.Answers an interactive yes/no notification. |
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | /api/audio/list | Elenco delle clip audio caricate.List of uploaded audio clips. |
| POST | /api/audio | Carica una clip audio (multipart form).Uploads an audio clip (multipart form). |
| GET | /api/audio/status | Stato della clip e del codec.Clip and codec status. |
| GET | /api/audio/cover | Copertina della clip richiesta.Cover art of the requested clip. |
| POST | /api/audio/play | Riproduce una clip WAV con volume opzionale.Plays a WAV clip with optional volume. |
| POST | /api/audio/delete | Elimina una clip dalla scheda SD.Deletes a clip from the SD card. |
| GET | /api/music/list | Elenco dei brani MP3 in una cartella.List of MP3 tracks in a folder. |
| POST | /api/music/play | Riproduce un brano MP3 con volume opzionale.Plays an MP3 track with optional volume. |
| POST | /api/music/stop | Ferma la riproduzione musicale.Stops music playback. |
| POST | /api/music/volume | Imposta il volume del player musicale.Sets the music player's volume. |
| GET | /api/music/status | Brano in corso e volume memorizzato.Current track and stored volume. |
| GET | /api/photos | Elenco delle immagini sulla SD.List of images on the SD card. |
| GET | /api/photos/list | Elenco delle immagini sulla SD.List of images on the SD card. |
| GET | /api/photos/show | Mostra un'immagine sul vetro.Shows an image on the glass. |
| POST | /api/photos/show | Mostra un'immagine sul vetro.Shows an image on the glass. |
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | /api/fs/list | Elenco del contenuto di una cartella sulla SD.Lists the contents of an SD-card folder. |
| POST | /api/fs/upload | Carica un file sulla SD (multipart, con chunking).Uploads a file to the SD card (multipart, chunked). |
| GET | /api/fs/download | Scarica un file dalla SD.Downloads a file from the SD card. |
| POST | /api/fs/delete | Elimina un file o una cartella.Deletes a file or a folder. |
| POST | /api/fs/mkdir | Crea una cartella.Creates a folder. |
| POST | /api/fs/rename | Rinomina o sposta un file.Renames or moves a file. |
| MetodoMethod | PercorsoPath | FunzionePurpose |
|---|---|---|
| GET | /api/streams | Elenco degli stream MJPEG salvati.List of saved MJPEG streams. |
| POST | /api/streams/save | Salva lo stream corrente.Saves the current stream. |
| POST | /api/streams/delete | Elimina uno stream salvato.Deletes a saved stream. |
| POST | /api/stream/play | Avvia uno stream sul vetro.Starts a stream on the glass. |
| GET | /api/stream | Stato dello stream: fps, risoluzione, byte trasmessi.Stream status: fps, resolution, bytes transferred. |
| GET | /api/stream/open | Apre uno stream da URL.Opens a stream from a URL. |
| POST | /api/stream/open | Apre uno stream da URL.Opens a stream from a URL. |
| GET | /api/stream/close | Chiude lo stream attivo.Closes the active stream. |
| POST | /api/stream/close | Chiude lo stream attivo.Closes the active stream. |
| GET | /api/stream/audio | Riproduce audio PCM da URL.Plays PCM audio from a URL. |
| POST | /api/stream/audio | Riproduce audio PCM da URL.Plays PCM audio from a URL. |
| GET | /api/news | Titoli dalle sorgenti RSS/Atom configurate.Headlines from configured RSS/Atom sources. |
| GET | /api/news/sources | Elenco delle sorgenti di notizie configurate.List of configured news sources. |
| POST | /api/news/sources | Salva le sorgenti di notizie.Saves news sources. |
sparky-amoled/src/web/WebService.cpp. Le route /api/defaults, /api/tts/info e /api/llm/select non appartengono al robot: sono endpoint del server di supporto e non vanno pubblicati qui. Alcune route sono implementate ma non documentate in docs/5-API-HTTP.md, come /api/version e /api/notify/respond.
The list derives from the registrations in sparky-amoled/src/web/WebService.cpp. The /api/defaults, /api/tts/info, and /api/llm/select routes do not belong to the robot: they are companion-server endpoints and must not be published here. Some routes are implemented but not documented in docs/5-API-HTTP.md, such as /api/version and /api/notify/respond.