Constructor
new Events(client)
Parameters:
Name | Type | Description |
---|---|---|
client |
BoxClient | The Box API Client that is responsible for making calls to the API |
- Source:
Methods
get(optionsopt, callbackopt) → {Promise.<Object>}
Get a chunk of events
API Endpoint: '/events'
Method: GET
To get events from admin events stream you have to pick stream_type from `admin_logs` or `admin_logs_streaming`.
The `admin_logs` stream emphasis is on completeness over latency,
which means that Box will deliver admin events in chronological order and without duplicates,
but with higher latency. You can specify start and end time/dates.
To monitor recent events that have been generated within Box across the enterprise use
`admin_logs_streaming` as stream type. The emphasis for this feed is on low latency rather than chronological
accuracy, which means that Box may return events more than once and out of chronological order.
Events are returned via the API around 12 seconds after they are processed by Box
(the 12 seconds buffer ensures that new events are not written after your cursor position).
Only two weeks of events are available via this feed, and you cannot set start and end time/dates.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Additional options for the request. Can be left null in most cases.
Properties
|
||||||||||||||||||||||||||||
callback |
function |
<optional> |
Passed the current stream position if successful |
- Source:
Returns:
A promise resolving to the collection of events
- Type
- Promise.<Object>
get(optionsopt, callbackopt) → {Promise.<Object>}
Get a chunk of events
API Endpoint: '/events'
Method: GET
To get events from admin events stream you have to pick stream_type from `admin_logs` or `admin_logs_streaming`.
The `admin_logs` stream emphasis is on completeness over latency,
which means that Box will deliver admin events in chronological order and without duplicates,
but with higher latency. You can specify start and end time/dates.
To monitor recent events that have been generated within Box across the enterprise use
`admin_logs_streaming` as stream type. The emphasis for this feed is on low latency rather than chronological
accuracy, which means that Box may return events more than once and out of chronological order.
Events are returned via the API around 12 seconds after they are processed by Box
(the 12 seconds buffer ensures that new events are not written after your cursor position).
Only two weeks of events are available via this feed, and you cannot set start and end time/dates.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Additional options for the request. Can be left null in most cases.
Properties
|
||||||||||||||||||||||||||||
callback |
function |
<optional> |
Passed the current stream position if successful |
- Source:
Returns:
A promise resolving to the collection of events
- Type
- Promise.<Object>
getCurrentStreamPosition(callbackopt) → {Promise.<string>}
Get the current stream position.
API Endpoint: '/events'
Method: GET
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<optional> |
Passed the current stream position if successful |
- Source:
Returns:
A promise resolving to the stream position
- Type
- Promise.<string>
getCurrentStreamPosition(callbackopt) → {Promise.<string>}
Get the current stream position.
API Endpoint: '/events'
Method: GET
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<optional> |
Passed the current stream position if successful |
- Source:
Returns:
A promise resolving to the stream position
- Type
- Promise.<string>
getEnterpriseEventStream(optionsopt, callbackopt) → {Promise.<EnterpriseEventStream>}
Create a stream of enterprise events.
By default, the stream starts from the current time.
Pass 'startDate' to start from a specific time.
Pass 'streamPosition' to start from a previous stream position, or '0' for all available past events (~1 year).
Once the stream catches up to the current time, it will begin polling every 'pollingInterval' seconds.
If 'pollingInterval' = 0, then the stream will end when it catches up to the current time (no polling).
By default, stream pools `admin_logs` for events. The emphasis for this stream is on completeness over latency,
which means that Box will deliver admin events in chronological order and without duplicates,
but with higher latency. You can specify start and end time/dates.
To monitor recent events that have been generated within Box across the enterprise use
`admin_logs_streaming` as stream type. The emphasis for this feed is on low latency rather than chronological
accuracy, which means that Box may return events more than once and out of chronological order.
Events are returned via the API around 12 seconds after they are processed by Box
(the 12 seconds buffer ensures that new events are not written after your cursor position).
Only two weeks of events are available via this feed, and you cannot set start and end time/dates.
This method will only work with an API connection for an enterprise admin account
or service account with a manage enterprise properties.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options
Properties
|
||||||||||||||||||||||||||||||||||||||||
callback |
function |
<optional> |
Passed the events stream if successful |
- Source:
Returns:
A promise resolving to the enterprise event stream
- Type
- Promise.<EnterpriseEventStream>
getEnterpriseEventStream(optionsopt, callbackopt) → {Promise.<EnterpriseEventStream>}
Create a stream of enterprise events.
By default, the stream starts from the current time.
Pass 'startDate' to start from a specific time.
Pass 'streamPosition' to start from a previous stream position, or '0' for all available past events (~1 year).
Once the stream catches up to the current time, it will begin polling every 'pollingInterval' seconds.
If 'pollingInterval' = 0, then the stream will end when it catches up to the current time (no polling).
By default, stream pools `admin_logs` for events. The emphasis for this stream is on completeness over latency,
which means that Box will deliver admin events in chronological order and without duplicates,
but with higher latency. You can specify start and end time/dates.
To monitor recent events that have been generated within Box across the enterprise use
`admin_logs_streaming` as stream type. The emphasis for this feed is on low latency rather than chronological
accuracy, which means that Box may return events more than once and out of chronological order.
Events are returned via the API around 12 seconds after they are processed by Box
(the 12 seconds buffer ensures that new events are not written after your cursor position).
Only two weeks of events are available via this feed, and you cannot set start and end time/dates.
This method will only work with an API connection for an enterprise admin account
or service account with a manage enterprise properties.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options
Properties
|
||||||||||||||||||||||||||||||||||||||||
callback |
function |
<optional> |
Passed the events stream if successful |
- Source:
Returns:
A promise resolving to the enterprise event stream
- Type
- Promise.<EnterpriseEventStream>
getEventStream(streamPositionopt, optionsopt, callbackopt) → {Promise.<EventStream>}
Create a stream of events, using the long-poll API to wait for new events.
API Endpoint: '/events'
Method: OPTIONS
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
streamPosition |
string |
<optional> |
Starting stream position | ||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters for the event stream
Properties
|
||||||||||||||||||||
callback |
function |
<optional> |
Passed the events stream if successful |
- Source:
Returns:
A promise resolving to the event stream
- Type
- Promise.<EventStream>
getEventStream(streamPositionopt, optionsopt, callbackopt) → {Promise.<EventStream>}
Create a stream of events, using the long-poll API to wait for new events.
API Endpoint: '/events'
Method: OPTIONS
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
streamPosition |
string |
<optional> |
Starting stream position | ||||||||||||||||||||
options |
Object |
<optional> |
Optional parameters for the event stream
Properties
|
||||||||||||||||||||
callback |
function |
<optional> |
Passed the events stream if successful |
- Source:
Returns:
A promise resolving to the event stream
- Type
- Promise.<EventStream>
getLongPollInfo(callbackopt) → {Promise.<Object>}
Get information for long-polling until new events are available
API Endpoint: '/events'
Method: OPTIONS
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<optional> |
Passed the long poll info if successful |
- Source:
Returns:
A promise resolving to the long poll info
- Type
- Promise.<Object>
getLongPollInfo(callbackopt) → {Promise.<Object>}
Get information for long-polling until new events are available
API Endpoint: '/events'
Method: OPTIONS
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<optional> |
Passed the long poll info if successful |
- Source:
Returns:
A promise resolving to the long poll info
- Type
- Promise.<Object>