Call the API from JavaScript

This working example uses plain fetch. No npm packages, framework, or build step are needed. Check the API address, sign in, and retrieve your manager profile.

The token stays in this page’s memory. Refreshing or closing the page ends this local session. If your own website uses a different origin, its address must be listed in the API’s Cors:AllowedOrigins.

Manager sign-in

The address is filled from the API site hosting this example. When hosting the example on your own portal, enter the API address provided by your administrator.

Ready.

No request sent yet.

Refresh profile reuses the existing token. There is no automatic polling. Account state and rights can take up to one minute to change in API responses.

Sign out discards this example’s token. The API currently has no endpoint to revoke an individual token; any other copy may work until expiry or account/password revocation. Your session in the official portal is separate.

Copy this page, javascript-demo.mjs, and portal-api.mjs into one folder in your own site. Serve it through HTTP(S), rather than opening it as a local file. See the guide for CORS setup and error handling.