Details on the various actions that can be performed on the
Events resource, including the expected
parameters and the potential responses.
Delete events
var params = {
applicationId: myApplicationId
};
// with callbacks
client.events.delete(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.events.delete(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, events.*, or events.delete.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
query |
Advanced Event Query |
N |
Query to apply to filter the events |
|
Advanced Event Query Example |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
200 |
Events Deleted |
If request successfully deletes a set of Events |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if events were not found |
Request an export of an application's event data
var params = {
applicationId: myApplicationId
};
// with callbacks
client.events.export(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.events.export(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, events.*, or events.export.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
exportData |
Event Export Options |
N |
Export options for events |
|
Event Export Options Example |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if application was not found |
Returns the events for an application
var params = {
applicationId: myApplicationId
};
// with callbacks
client.events.get(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.events.get(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, events.*, or events.get.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
sortField |
string |
N |
Field to sort the results by. Accepted values are: subject, id, creationDate, lastUpdated, level, state, deviceId |
creationDate |
subject |
sortDirection |
string |
N |
Direction to sort the results by. Accepted values are: asc, desc |
desc |
asc |
page |
string |
N |
Which page of results to return |
0 |
0 |
perPage |
string |
N |
How many items to return per page |
100 |
10 |
filterField |
string |
N |
Field to filter the results by. Blank or not provided means no filtering. Accepted values are: subject |
|
subject |
filter |
string |
N |
Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. |
|
abnormal power to * |
state |
string |
N |
If provided, return events only in the given state. Accepted values are: new, acknowledged, resolved |
|
new |
query |
Advanced Event Query |
N |
Event filter JSON object which overrides the filterField, filter, and state parameters. |
|
Advanced Event Query Example |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
200 |
Events |
Collection of events |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if application was not found |
Returns the first new event ordered by severity and then creation
var params = {
applicationId: myApplicationId
};
// with callbacks
client.events.mostRecentBySeverity(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.events.mostRecentBySeverity(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, events.*, or events.mostRecentBySeverity.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
filter |
string |
N |
Filter to apply against event subjects. Supports globbing. Blank or not provided means no filtering. |
|
abnormal power to * |
query |
Advanced Event Query |
N |
Event filter JSON object which overrides the filter parameter. |
|
Advanced Event Query Example |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
404 |
Error |
Error if application was not found |
Asynchronously updates information for matching events by subject and/or current state
var params = {
applicationId: myApplicationId,
updates: myUpdates
};
// with callbacks
client.events.patch(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.events.patch(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Organization, all.User, events.*, or events.patch.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
filterField |
string |
N |
Field to filter the events to act on by. Blank or not provided means no filtering. Accepted values are: subject |
|
subject |
filter |
string |
N |
Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. |
|
abnormal power to * |
state |
string |
N |
If provided, act on events only in the given state. Accepted values are: new, acknowledged, resolved |
|
new |
query |
Advanced Event Query |
N |
Event filter JSON object which overrides the filterField, filter, and state parameters. |
|
Advanced Event Query Example |
updates |
Event Patch |
Y |
Object containing updated information for the events |
|
Event Patch Example |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if application is not found |
Create a new event for an application
var params = {
applicationId: myApplicationId,
event: myEvent
};
// with callbacks
client.events.post(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.events.post(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Organization, all.User, events.*, or events.post.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
event |
Event Post |
Y |
New event information |
|
Event Post Example |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
201 |
Event |
Successfully created event |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if application was not found |
429 |
Error |
Error if event creation rate limit exceeded |