Skip to content

Real-time measurement stream (SSE, text/event-stream)

GET /modules/{id}/stream
  • Scope readings:read
  • API key x-api-key
  • Base URL https://api.hub.akuasense.com/v1

Server-Sent Events stream, open for as long as the client keeps it. Four kinds of lines:

  • event: ready — on opening: { "module_id": 256 };
  • event: measurement — the CALIBRATED snapshot of the module, all depths, with the same body as GET /modules/{id}/measurements/latest. Sent right after ready, then every time a burst of measurements lands;
  • event: reading — a measurement has just arrived: module_id, module_sensor_id (the sensor, see the module’s sensors[].id) and measured_at. A frame arrives sensor by sensor: expect a burst, followed by the snapshot;
  • : ping — a comment every 25 seconds, which keeps the connection open.

No replay after a drop: on reconnection, the initial snapshot gives the current state again.

Path parameters

  • id integer required

Response

200

Stream open

Response body not documented.

Errors

  • 400

    Invalid parameter

    invalid_id
  • 401

    Not authenticated

  • 403

    Insufficient scope, or resource outside your company