API Integration

The Provision Portal UI talks to exactly one service at runtime: the Provision Portal backend REST API, reached through the same-origin /prov-api/ reverse proxy.

Backend base path

The browser calls the relative base path from app.config.json, patched at container start to /prov-api/ (see Configuration). Nginx proxies it to the backend /prov-portal/ context path (FT_PROV_API_URL).

All services go through a single ApiService, which prefixes apiUrl and JSON-serialises request bodies. It exposes post, put, patch, delete, and a multipart file helper.

Endpoint groups

Service Endpoints (relative to /prov-api/)

AuthService

ui/auth/login, ui/auth/logout

ProvisionService

ui/provision, ui/provision/status, ui/provision/upload, ui/provision/multiple, ui/provision/deactivate, ui/provision/replace-cpe

DeviceService

ui/device/domains, device/device

ServerService

ui/server/configuration, ui/server/version, ui/server/logs

UserService

user listing, update, and delete (user management)

Request flow

  • Feature components call a service method; the service calls ApiService, which issues the HTTP request through the interceptor chain.

  • AuthInterceptor attaches Authorization: Bearer <token> from sessionStorage when a token is present.

  • ErrorHandlerInterceptor catches HTTP errors and shows a ngx-toastr message. It skips error code 0000 (a token-interceptor signal) and the auth/logout call.

Authentication

AuthService.login() posts credentials to ui/auth/login, stores the returned token and user id in sessionStorage (token, currentUserId), and shows a success toast. logout() posts to ui/auth/logout and clears sessionStorage.

Server-driven configuration

ServerService fetches ui/server/configuration once and caches it in a signal (and sessionStorage). This server config drives feature flags — for example, ConfigGuard gates the Deactivate Service page on deactivateService.enable.