Skip to main content

Appendix

Server-Sent Events (SSE)

Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via an HTTP connection. The Server-Sent Events EventSource API is standardized as part of HTML5 by the W3C.

Receiving events from the server

Our SSE APIs require a token to access the data from the server. You can log in with your OS account or the "admin" account to get the token (token field from the response body) or use Secure and HttpOnly cookies (if available).

// Open a connection
const evtSource = new EventSource("/THE_SSE_API?token=", { withCredentials: true } );

// Handle events
evtSource.addEventListener(, (event) => {
const data = JSON.parse(event.data);
// Process your data
});

See Also

https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events

Invoking a REST API via Postman

Prerequisite

  1. Turn off SSL certificate verification

    postman_settings.png

  2. Login with your OS account or the "admin" account to get a token

    postman_login.png

Calling GET /platform/api/host/info

  1. Switch to Authorization Tab and set TYPE to Bearer Token

  2. Input the token from Prerequisite Step 2

  3. Send the Request

    postman_hostinfo.png

Calling PUT /platform/api/perif/wdt

  1. Switch to Authorization Tab and set TYPE to Bearer Token

  2. Input the token from Prerequisite Step 2

    postman_wdtauth.png

  3. Switch to Body Tab, select raw and JSON, then input the request body as below

    {
    "enabled": true
    }

    postman_wdtenabled.png

  4. Send the Request