Getting and displaying Events
Getting and displaying Events
In many cases, you'll want to display a list of events for your users to select one, or at the very least you'll want to fetch the data of a single event in order to contextualise the Elements the user is seeing.
While you may not always want to process the currently active Event, this is the most common approach to selecting which Event is the focal point. The snippet below illustrates how to retrieve the list of all available Events and identify one that is currently in the active
state.
Additionally, you can be notified of any updates to the Event using this snippet:
Alternatively, you can also obtain the Event by its ID. This is useful if you want to attach a given known Event to specific information in your platform. For instance, you could create an Event for a given football match, and then link all the articles relevant to that match to the Event, so that you display match details, or interactive Elements relevant to that match within the article.
The following snippet showcases how to get an Event from an ID, which we'll assume in this case is being provided by your API.
Last updated
Was this helpful?