Events
Events are logged on many API write actions such as item creation, update, and delete. Document emissions and other significant events are also logged.
Events can be leveraged in several ways, from auditing to performing custom actions in certain circumstances, although, in that case, WebHooks are probably the best option.
Events log
You can query the events log anytime, as it is available on the Customer
API at the /api/v{version}/Evento
endpoint.
Note
The events log endpoint is available only to admin-level accounts.
The event record
Every event is composed of the following properties:
Event property name | Description |
---|---|
Id |
Unique event ID. |
EventGuid |
Event Guid. |
Type |
Event type (e.g., "Documento.Create"). |
DateTime |
Date and time of the event. |
CompanyId |
Company ID on which the event occurred. |
ApiVersion |
Version of the API that triggered the event. |
ApplicationId |
Application ID contained within the request that triggered the event. |
ApiKey |
API key used to trigger the event. This value is redacted on WebHook payloads. |
Object |
Object involved. For "Documento.Create", it would be the document created. |
Event persistence
Events are persisted for 15 days. Older events are removed daily to make room for new ones.
SDK support
The NET SDK offers full support for the events log via the EventoService
class. Here's a code snippet that retrieves the last 50 events that occurred on
company ID 1:
var options = new ListOptions<Evento> { Take = 50 };
options.AddSort("DateTime", Direction.Descending);
var service = new EventoService();
var response = await service.List(options);
if (response.IsSuccess)
foreach (var @event in response.Result!)
Console.WriteLine($"Event '{@event.EventGuid}' of type {@event.Type} was fired at {@event.DateTime} by {@event.ApplicationId}.");
We plan on supporting the events log in future SDKs as well.
Limitations
- The legacy Amica 20 for Windows application does not use the cloud APIs
documented on this website. Currently, only
Documento
write events, along with theDocumento.Emit
event, are logged by that application, so keep that in mind when planning your integration. The official web application supports the full range of events and WebHooks.