====== 1.1 Endpoint REST ====== Panoramica di tutti gli endpoint REST((Representational State Transfer: https://it.wikipedia.org/wiki/Representational_State_Transfer)) disponibili. ===== Architettura ===== L'API segue i principi REST((REST Constraints: https://restfulapi.net/rest-architectural-constraints/)) e usa metodi HTTP((Hypertext Transfer Protocol: https://datatracker.ietf.org/doc/html/rfc7231)) per operazioni CRUD. ===== Tabelle ===== ^ Metodo ^ Route ^ Descrizione ^ | GET | ''/tables'' | Lista di tutte le tabelle | | GET | ''/tables/{name}'' | Leggere dati | | POST | ''/tables/{name}'' | Inserire record | | PUT | ''/tables/{name}'' | Aggiornare record | | DELETE | ''/tables/{name}'' | Eliminare record | | PATCH | ''/tables/{name}'' | [[.:entwickler:rest:batch|Modifiche batch]] | ===== Viste ===== ^ Metodo ^ Route ^ Descrizione ^ | GET | ''/views'' | Lista di tutte le viste | | GET | ''/views/{name}'' | Leggere dati vista | ===== Stored Procedures ===== ^ Metodo ^ Route ^ Descrizione ^ | GET | ''/procedures'' | Lista di tutte le procedure | | POST | ''/procedures/{name}/execute'' | Eseguire procedura | ===== Query Ad-Hoc ===== ^ Metodo ^ Route ^ Descrizione ^ | POST | ''/query'' | Eseguire query SQL | ===== Codici di Stato HTTP ===== L'API usa codici di stato HTTP standard((HTTP Status Codes: https://datatracker.ietf.org/doc/html/rfc7231#section-6)): ^ Codice ^ Significato ^ Utilizzo ^ | 200 | OK | GET/PUT/PATCH riuscito | | 201 | Created | POST riuscito | | 204 | No Content | DELETE riuscito | | 400 | Bad Request | Richiesta non valida | | 401 | Unauthorized | Autenticazione richiesta | | 403 | Forbidden | Nessuna autorizzazione | | 404 | Not Found | Risorsa non trovata | | 500 | Server Error | Errore interno | ===== Approfondimenti ===== * [[.:entwickler:rest:query-parameter|Parametri query]] per filtri e ordinamento * [[.:entwickler:rest:crud|Operazioni CRUD]] in dettaglio * [[.:entwickler:rest:batch|Operazioni batch]] per modifiche massive ===== Fonti ===== * [[https://datatracker.ietf.org/doc/html/rfc7231|RFC 7231: HTTP/1.1 Semantics]] * [[https://restfulapi.net/|REST API Tutorial]]