Aggregates

The aggregate endpoints /v1/contexts/{context}/aggregate/{aggregateId}/events and /v1/contexts/{context}/aggregate/{aggregateId}/eventsPaged allow one to retrieve events for an aggregate. The eventsPaged endpoint offers pagination.

Paginated event retrieval

As for the events endpoint, you need to specify the context and AggregateId. Further, you need to specify the pageSize (number of events per page) and pageOffset (how many pages to skip). In the response, the isLast field siglals if this page is the last one and a request with the pageSize size and an incremented pageOffset will return 404.

Pagination example

If an event store contains the events 0, 1, 2, 3, 4, pageSize=2, the pages will contain the events as follows: - pageOffset=0: 0, 1, isLast: false - pageOffset=1: 2, 3, isLast: false - pageOffset=2: 4, isLast: true