====== 1.1 REST endpointi ====== Pregled svih dostupnih REST((Representational State Transfer: https://de.wikipedia.org/wiki/Representational_State_Transfer)) endpointa. ===== Arhitektura ===== API slijedi REST principe((REST Constraints: https://restfulapi.net/rest-architectural-constraints/)) i koristi HTTP((Hypertext Transfer Protocol: https://datatracker.ietf.org/doc/html/rfc7231)) metode za CRUD operacije. ===== Tablice ===== ^ Metoda ^ Ruta ^ Opis ^ | GET | ''/tables'' | Popis svih tablica | | GET | ''/tables/{name}'' | Čitanje podataka | | POST | ''/tables/{name}'' | Umetanje zapisa | | PUT | ''/tables/{name}'' | Ažuriranje zapisa | | DELETE | ''/tables/{name}'' | Brisanje zapisa | | PATCH | ''/tables/{name}'' | [[.:entwickler:rest:batch|Batch promjene]] | ===== Pogledi ===== ^ Metoda ^ Ruta ^ Opis ^ | GET | ''/views'' | Popis svih View-ova | | GET | ''/views/{name}'' | Čitanje podataka View-a | ===== Pohranjene procedure ===== ^ Metoda ^ Ruta ^ Opis ^ | GET | ''/procedures'' | Popis svih procedura | | POST | ''/procedures/{name}/execute'' | Izvršavanje procedure | ===== Ad-Hoc upiti ===== ^ Metoda ^ Ruta ^ Opis ^ | POST | ''/query'' | Izvršavanje SQL upita | ===== HTTP statusni kodovi ===== API koristi standardne HTTP statusne kodove((HTTP Status Codes: https://datatracker.ietf.org/doc/html/rfc7231#section-6)): ^ Kod ^ Značenje ^ Korištenje ^ | 200 | OK | Uspješan GET/PUT/PATCH | | 201 | Created | Uspješan POST | | 204 | No Content | Uspješan DELETE | | 400 | Bad Request | Nevažeći zahtjev | | 401 | Unauthorized | Potrebna autentifikacija | | 403 | Forbidden | Nema dozvole | | 404 | Not Found | Resurs nije pronađen | | 500 | Server Error | Interna greška | ===== Nastavak ===== * [[.:entwickler:rest:query-parameter|Query parametri]] za filtere i sortiranje * [[.:entwickler:rest:crud|CRUD operacije]] detaljno * [[.:entwickler:rest:batch|Batch operacije]] za masovne promjene ===== Izvori ===== * [[https://datatracker.ietf.org/doc/html/rfc7231|RFC 7231: HTTP/1.1 Semantics]] * [[https://restfulapi.net/|REST API Tutorial]]