/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.
| Field | Meaning |
|---|---|
asOf | Time of the snapshot |
entries[].locationId | The location the client occupies |
entries[].locationPath | Full path in the location tree, e.g. Building A/Floor 2/Desk 5 |
entries[].externalLocationId | Id in your partner system; empty in pure Shigoto operation |
entries[].clientId | Pseudonymous client key, rotates once per day |
entries[].deviceType | Which device types evidenced this presence so far, e.g. ["Monitor","Usb"] |
entries[].category | Derived from deviceType: location, environment, mixed or unknown |
entries[].from | Start of the presence |
entries[].to | Always null — the presence is still running |
entries[].currentUser | Number 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.
fromis 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
- 200
- 400
- 404
OK
Bad Request
Not Found