const events = [
{ description: 'Workorder pump abc', startTime: new Date('22 jan 2019') },
{ description: 'Broken rule', externalId: 'rule123', startTime: 1557346524667000 },
];
const createdEvents = await client.events.create(events);
const events = await client.events.list({ filter: { startTime: { min: new Date('1 jan 2018') }, endTime: { max: new Date('1 jan 2019') } } });
const events = await client.events.retrieve([{id: 123}, {externalId: 'abc'}]);
const events = await client.events.search({
filter: {
assetIds: [1, 2]
},
search: {
description: 'Pump'
}
});
const events = await client.events.update([{id: 123, update: {description: {set: 'New description'}}}]);
The aggregation API allows you to compute aggregated results on events like getting the count of all events in a project or checking what are all the different types and subtypes of events in your project, along with the count of events in each of those aggregations. By specifying an additional filter, you can also aggregate only among events matching the specified filter.