How to query
You can use the query below to get the latest content matching your API subscription:
Where:
- {stream_id} is the identifier for a given steam.
- {event_number} is the last event number processed (-1 is the start).
- {batch_size} is the maximum number of events to return, capped at 1000.
The server will return as many events as specified in the The server will return as many events as specified in the {batch_size} or as many as are available, whichever is smaller. When no events are returned the end of the stream has been reached.
When no new events are available the server will hold the connection open until new events are available, for up to five seconds. This means events will be pushed to the client as soon as they become available in the system. The header ‘X-Long-Poll’ can be used to configure how long the server should hold the connection open awaiting new events.
Given a stream with five events, numbered 0 to 4, the following would return immediately with event 4:
Given the same stream of five events, the below would return after 10 seconds or when the event with number 5 is published:
If the intent is to subscribe to the live stream, a new request should be made whenever the previous has completed. When there are no new events the same request is repeated. Otherwise the event number is updated to that of the last processed event.
To get the latest event number the following will give you the most recent ten events:
Response
Ideas are represented as an ordered sequence of events (e.g. opened, updated, closed) with a correlation identifier. To construct the current state of an Idea all of its events must be processed in the provided order. If there is a problem with an event, the system will stop publishing new events to protect data integrity until Acuris has resolved the underlying issue.
The following is an example of an ‘IdeaOpened’ event:
The following is an example of an ‘IdeaUpdated’ event:
The following is an example of an ‘IdeaClosed’ event: