Skip to main content

/statistic/open: Get the presences that are running right now.

GET 

/statistic/open

What

Returns one row per presence that has not ended yet: a client has been sitting at a location since from. This is the live complement to GET /statistic/entries, which only lists a presence once it is over.

The result is a snapshot, not a log. It is always complete — there is no paging, no time window and no changedSince. asOf is the server time the snapshot was taken at. Poll the endpoint as often as your dashboard refreshes; do not store the rows, every call replaces the previous one.

FieldMeaning
asOfTime of the snapshot
entries[].locationIdThe location the client occupies
entries[].locationPathFull path in the location tree, e.g. Building A/Floor 2/Desk 5
entries[].externalLocationIdId in your partner system; empty in pure Shigoto operation
entries[].clientIdPseudonymous client key, rotates once per day
entries[].deviceTypeWhich device types evidenced this presence so far, e.g. ["Monitor","Usb"]
entries[].categoryDerived from deviceType: location, environment, mixed or unknown
entries[].fromStart of the presence
entries[].toAlways null — the presence is still running
entries[].currentUserNumber of people this row represents. Always 1 today

Rows are ordered by from, oldest first. The row format equals GET /statistic/entries, so both results can be merged into one table. All timestamps are UTC with microsecond precision, as in the history.

Combining with the history

When a presence ends it disappears here and appears in GET /statistic/entries with the same clientId, locationId and from, now carrying its to. For a curve that reaches up to the present, take the entries of today and add the rows from here with asOf as their provisional to.

The two calls are not taken at the same instant. A presence that ends between them can show up in both results; clientId + locationId + from identifies it, and the row from GET /statistic/entries is the final one. from is written identically by both endpoints, so the three values can be compared as plain text.

When a presence appears and disappears

  • It appears 60 seconds after it began. Shorter presences are discarded as noise and never become a statistic entry, so they are not shown here either.
  • A client that signs off or moves on disappears immediately. A client that vanishes without signing off (standby, lost network) stays listed for about 13 seconds, until the server notices the missing heartbeat.
  • Running presences are cut at midnight, exactly as in the history. from is therefore never earlier than today, 00:00 server time; the part before is already an entry.
  • After a server restart the list is empty for about a minute: the running presences were closed and written as entries, and begin anew with the next heartbeat.

Counting people

Count COUNT(DISTINCT clientId), never the number of rows. Someone whose monitor identifies a desk and whose Wi-Fi identifies the room appears once per location.

Who

Account administrators of the account (and higher). A caller below tenant level always receives their own account's data, regardless of the accountId passed.

Login

Login or API key (both allowed).

Request​

Responses​

OK