The /api/log/subscribe function helps you create a subscription channel and returns a unique identifier to be used for subsequent dialling of the /api/log/pull or /api/log/unsubscribe function.
Each subscription channel contains an event queue of its own. All the new events that match the channel filter (filter parameter) are added to the channel queue and read using the /api/log/pull function.
At the same time, the device keeps the event history queue (last 500 events) in its internal memory. The event history queue is empty by default.
Use the include parameter to specify whether the channel queue shall be empty after restart (storing of events occurring after the channel is opened), or be filled with all or some events from the event history records.
Use the duration parameter to define the channel duration if it is not accessed via /api/log/pull. The channel will be closed automatically when the defined timeout passes as if the /api/log/unsubscribe function were used.
The function is part of the Logging service and requires some user privileges for authentication. Unprivileged user events shall not be included in the channel queue.
|Event type||Required user privileges|
|CardEntered||UID monitoring (cards/Wiegand)|
The GET or POST method can be used for this function.
Define the events to be added to the channel event queue:
new - only new events occurring after channel creation
all - all events recorded so far including those occurring after channel creation
-t - all events recorded in the last t seconds including those occurring after channel creation (-10, e.g.)
|filter||list||No||no filter||List of required event types separated with commas. The parameter is optional and if no value is entered, all available event types are transferred via the channel.|
|duration||uint32||No||90||Define a timeout in seconds after which the channel shall be closed automatically if no /api/log/pull reading operations are in progress. Every channel reading automatically extends the channel duration by the value included here. The maximum value is 3600 s.|
The reply is in the application/json format and includes an identifier created by subscription.
Unique identifier created by subscription