Internal API Contract (UI↔BE)
*Status:* v1.0 authoritative · Owner: Backend and Frontend (shared; the person running the session signs off) · Last reviewed: 2026-06-26
This is the internal POST-RPC contract between the Angular UI and its own Java backend (oneiot-ui / iotw). Frontend (FE) and backend (BE) engineers read it. It is hand-kept (no code generation), so a change lands here first and identically on both sides.
| The outward-facing northbound API (REST + OpenAPI) is a different surface. See the External API Contract. The Java and Angular standards both link here. |
The contract
| Element | Shape | Who proposes a change |
|---|---|---|
Envelope |
|
BE |
Pagination |
|
BE |
Error codes |
Numeric |
BE (the BE also owns the list of codes) |
Error body |
Three fields: |
BE |
URL style |
POST-RPC |
Either side (both sides must agree) |
Verb and path of an operation |
One verb per kind of operation, and the path |
Either side (both sides must agree) |
Identity |
|
Either side (both sides must agree) |
The last column names the side that proposes a change. Every change lands on both sides in one coordinated pull request (see Changing the contract).
In oneiot-ui each entry of the error registry stores an HTTP status, and the handler sends that status (GlobalExceptionHandler.java:137). Examples: 9024 is sent with 404, and 9018 with 403 (ServicesErrorRegistryEnum.java:110-153).
|
API operations: verb, path and types
The URL is /{controller}/{action}, where action is a resource noun. Reads carry their filter or id in the request body, not the query string.
The HTTP verb is fixed per kind of operation (reference: angular-ui ApiService + device.service.ts).
Do not apply this table to the northbound REST APIs (ft-northbound-api, ft-service-api, ft-provision-api). The External API Contract and the Java standard, J13 govern them.
| 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 |
The filter, the paging and the id travel in the JSON body. Complex queries stay uniform. |
|
Singular means one entity (create, get one). Plural means a collection (list, bulk delete). |
Create and update both use |
FT convention. The |
|
Bulk delete by |
|
|
FE method naming |
|
The BE controller must expose exactly these verb+path pairs, and the FE service must call them by these names. Do not add a 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 and Overview. |