Internal API Contract — UI ↔ Backend (FE↔BE)
*Status:* v1.0 authoritative · Owner: Backend + Frontend (shared, CTO sign-off) · Last reviewed: 2026-06-26 · Review cadence: quarterly
This is the internal API: the Angular UI talking to its own Java backend (oneiot-ui / iotw).
It is POST-RPC and hand-kept — no codegen — so it must change here first, identically on both sides.
The frontend and backend are built by different teams against separate standards but meet at this one wire contract; both the Java and Angular standards link here.
| For the outward-facing API consumed by other systems (northbound / public / integration), see the External API Contract — that’s a different surface (REST + OpenAPI), not this one. |
The contract
| Element | Shape | Owner of change |
|---|---|---|
Envelope |
|
BE proposes |
Pagination |
|
BE proposes |
Error codes |
numeric |
BE owns the list |
URL style |
POST-RPC |
shared |
Identity |
|
shared |
API operations — verb, path & types per operation
This page is the internal FE↔BE surface: POST-RPC, not REST — the URL is /{controller}/{action}
where action is a resource noun, and reads carry their filter/id in the request body (not the query
string). The HTTP verb is fixed per kind of operation as below (reference: angular-ui ApiService
device.service.ts).
| FT also has a northbound / public REST surface (ft-northbound-api, ft-service-api, ft-provision-api) with proper verbs + OpenAPI — that’s a different style; see Java standard §J12. Don’t apply this POST-RPC table to those. |
| Operation | Verb | Path (action) |
Request body → Response | FE service method |
|---|---|---|---|---|
List / query |
|
|
filter + |
|
Get by id |
|
|
|
|
Create |
|
|
the new DTO → |
|
Update |
|
|
the changed DTO → |
|
Delete (bulk by id) |
|
|
|
|
Sub-resource |
|
|
|
|
| Rule | Why / detail |
|---|---|
Reads use |
filter/paging/id travel in the JSON body; keeps complex queries uniform |
|
singular = one entity (create / get-one); plural = a collection (list / bulk-delete) |
Create and update both use |
FT convention — distinguish by |
|
bulk delete by |
|
|
FE method naming |
|
This is the hand-kept contract — the BE controller must expose exactly these verb+path pairs and
the FE service must call them by these names. Don’t introduce REST-style GET /items/{id} on one side only.
|
How each side uses it
| Backend (Java) | Frontend (Angular) |
|---|---|
|
|
Changing the contract
|
| Next → External API (REST) · Java · Angular · Overview. |