public class EventsManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EventsManager.Builder |
| Modifier and Type | Field and Description |
|---|---|
Authentication |
auth |
NetworkSession |
networkSession |
| Modifier | Constructor and Description |
|---|---|
|
EventsManager() |
protected |
EventsManager(EventsManager.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
Authentication |
getAuth() |
Events |
getEvents()
Returns up to a year of past events for a given user or for the entire enterprise.
|
Events |
getEvents(GetEventsHeaders headers)
Returns up to a year of past events for a given user or for the entire enterprise.
|
Events |
getEvents(GetEventsQueryParams queryParams)
Returns up to a year of past events for a given user or for the entire enterprise.
|
Events |
getEvents(GetEventsQueryParams queryParams,
GetEventsHeaders headers)
Returns up to a year of past events for a given user or for the entire enterprise.
|
EventStream |
getEventStream()
Get an event stream for the Box API
|
EventStream |
getEventStream(GetEventStreamHeaders headers)
Get an event stream for the Box API
|
EventStream |
getEventStream(GetEventStreamQueryParams queryParams)
Get an event stream for the Box API
|
EventStream |
getEventStream(GetEventStreamQueryParams queryParams,
GetEventStreamHeaders headers)
Get an event stream for the Box API
|
RealtimeServers |
getEventsWithLongPolling()
Returns a list of real-time servers that can be used for long-polling updates to the [event
stream](https://developer.box.com/reference/get-events).
|
RealtimeServers |
getEventsWithLongPolling(GetEventsWithLongPollingHeaders headers)
Returns a list of real-time servers that can be used for long-polling updates to the [event
stream](https://developer.box.com/reference/get-events).
|
NetworkSession |
getNetworkSession() |
public Authentication auth
public NetworkSession networkSession
public EventsManager()
protected EventsManager(EventsManager.Builder builder)
public RealtimeServers getEventsWithLongPolling()
Long polling is the concept where a HTTP request is kept open until the server sends a response, then repeating the process over and over to receive updated responses.
Long polling the event stream can only be used for user events, not for enterprise events.
To use long polling, first use this endpoint to retrieve a list of long poll URLs. Next, make a long poll request to any of the provided URLs.
When an event occurs in monitored account a response with the value `new_change` will be sent. The response contains no other details as it only serves as a prompt to take further action such as sending a request to the [events endpoint](https://developer.box.com/reference/get-events) with the last known `stream_position`.
After the server sends this response it closes the connection. You must now repeat the long poll process to begin listening for events again.
If no events occur for a while and the connection times out you will receive a response with the value `reconnect`. When you receive this response you’ll make another call to this endpoint to restart the process.
If you receive no events in `retry_timeout` seconds then you will need to make another request to the real-time server (one of the URLs in the response for this endpoint). This might be necessary due to network errors.
Finally, if you receive a `max_retries` error when making a request to the real-time server, you should start over by making a call to this endpoint first.
public RealtimeServers getEventsWithLongPolling(GetEventsWithLongPollingHeaders headers)
Long polling is the concept where a HTTP request is kept open until the server sends a response, then repeating the process over and over to receive updated responses.
Long polling the event stream can only be used for user events, not for enterprise events.
To use long polling, first use this endpoint to retrieve a list of long poll URLs. Next, make a long poll request to any of the provided URLs.
When an event occurs in monitored account a response with the value `new_change` will be sent. The response contains no other details as it only serves as a prompt to take further action such as sending a request to the [events endpoint](https://developer.box.com/reference/get-events) with the last known `stream_position`.
After the server sends this response it closes the connection. You must now repeat the long poll process to begin listening for events again.
If no events occur for a while and the connection times out you will receive a response with the value `reconnect`. When you receive this response you’ll make another call to this endpoint to restart the process.
If you receive no events in `retry_timeout` seconds then you will need to make another request to the real-time server (one of the URLs in the response for this endpoint). This might be necessary due to network errors.
Finally, if you receive a `max_retries` error when making a request to the real-time server, you should start over by making a call to this endpoint first.
headers - Headers of getEventsWithLongPolling methodpublic Events getEvents()
By default this returns events for the authenticated user. To retrieve events for the entire enterprise, set the `stream_type` to `admin_logs_streaming` for live monitoring of new events, or `admin_logs` for querying across historical events. The user making the API call will need to have admin privileges, and the application will need to have the scope `manage enterprise properties` checked.
public Events getEvents(GetEventsQueryParams queryParams)
By default this returns events for the authenticated user. To retrieve events for the entire enterprise, set the `stream_type` to `admin_logs_streaming` for live monitoring of new events, or `admin_logs` for querying across historical events. The user making the API call will need to have admin privileges, and the application will need to have the scope `manage enterprise properties` checked.
queryParams - Query parameters of getEvents methodpublic Events getEvents(GetEventsHeaders headers)
By default this returns events for the authenticated user. To retrieve events for the entire enterprise, set the `stream_type` to `admin_logs_streaming` for live monitoring of new events, or `admin_logs` for querying across historical events. The user making the API call will need to have admin privileges, and the application will need to have the scope `manage enterprise properties` checked.
headers - Headers of getEvents methodpublic Events getEvents(GetEventsQueryParams queryParams, GetEventsHeaders headers)
By default this returns events for the authenticated user. To retrieve events for the entire enterprise, set the `stream_type` to `admin_logs_streaming` for live monitoring of new events, or `admin_logs` for querying across historical events. The user making the API call will need to have admin privileges, and the application will need to have the scope `manage enterprise properties` checked.
queryParams - Query parameters of getEvents methodheaders - Headers of getEvents methodpublic EventStream getEventStream()
public EventStream getEventStream(GetEventStreamQueryParams queryParams)
queryParams - Query parameters of getEvents methodpublic EventStream getEventStream(GetEventStreamHeaders headers)
headers - Headers of getEvents methodpublic EventStream getEventStream(GetEventStreamQueryParams queryParams, GetEventStreamHeaders headers)
queryParams - Query parameters of getEvents methodheaders - Headers of getEvents methodpublic Authentication getAuth()
public NetworkSession getNetworkSession()