Events Listener
This API allows you to listen to :ref:`Nextcloud events <Events>`.
Currently only a limited number of events are supported.
Please let us know if there are any specific event we should add support to.
Register
OCS endpoint: POST /apps/app_api/api/v1/events_listener
Params
{
"eventType": "node_event",
"actionHandler": "/action_handler_route"
"eventSubtypes": [],
}
Unregister
OCS endpoint: DELETE /apps/app_api/api/v1/events_listener
Params
To unregister EventsListener, you just need to provide an eventType for the registered EventsListener:
{
"eventType": "node_event"
}
Event payload
{
"event_type": "node_event",
"event_subtype": "NodeCreatedEvent",
"event_data": "associative array depending on `event_subtype`"
}
Events types
Node Events
node_event - events about File Nodes
- Supported event sub-types:
NodeCreatedEvent
NodeTouchedEvent
NodeWrittenEvent
NodeDeletedEvent
NodeRenamedEvent
NodeCopiedEvent
For all Node events, event_data contains a target key which has the same format as in :ref:`FileActionsMenu payload <node_info>`.
For NodeCopiedEvent and NodeRenamedEvent, there is also a source key in the same format.