API reference
Stream readings
- SSE
- GET https://api.inorbit.hr/v1/atlas/signals/eventsAccept: text/event-stream; one data: line of JSON per event
- WebSocket
- wss://api.inorbit.hr/v1/ws{"type":"call","id":"1","method":"iohr.sensors.v1.SensorsService/StreamSignals","body":{…}}
- MQTT 5
- wss://api.inorbit.hr/v1/mqttsubscribe to atlas/signals/events
An account's readings as they arrive, as server-sent events with ids: reconnect with Last-Event-ID to resume. A client that falls behind gets a summary of what it missed instead of every reading.
Needs scope atlas-signals:read.
bearerAuthorizationBearer <JWT>An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.
account_id?stringA team you belong to, to act on its events; empty for your own account.
sensors?stringOnly these sensors, comma-separated; empty for all.
after?stringResume after this cursor; the Last-Event-ID header wins when both are set.
A stream of iohr.sensors.v1.StreamSignalsResponse events, one JSON object per data:; a failure is an error event carrying Problem
text/event-stream- response
iohr.sensors.v1.StreamSignalsResponse
missed*stringint64reading?iohr.sensors.v1.Reading
sse_id*stringtype*stringimport { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try { for await (const event of api.sensors.streamSignals()) { console.log(event); }} catch (e) { if (!(e instanceof ApiError)) throw e; console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`); process.exitCode = 1;}npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.
{ "missed": "string", "reading": { "cursor": "string", "evidence_digest": "string", "labels": { "property1": "string", "property2": "string" }, "produced_at": "string", "received_at": "string", "sensor_id": "string", "skewed": true, "state": "string", "value": 0.1 }, "sse_id": "string", "type": "string"}