Event documents

Event store and documents

Events (schedule or listings) are a collection of documents of type event in the content instance store.

Using either the loop or recursive technique in the Source section above we can retrieve 1000 event documents at a time with the following GET request.

GET https://<base-url>/stores-active/contentinstance/event/filter?offset=0&limit=100&api_key=<api-key>

Increment the offset value by 1000 (your limit value) for each iteration.

Chunking by property

If you understand the relationships between the document types, we know that events are connected to sources. For each event there are sourceId and source properties that identify the source the event is occuring on.

The following will retrieve all the event documents of the source with ID “97

GET: https://<base-url>/stores-active/contentinstance/event/filter?filter={"term":"sourceId","value":"97"}&api_key=<api-key>

Explanation

Paramenter description
filter={“term”:”sourceId”,”value”:”97″} filter the response to documents whose sourceId property has the value of “97”

Therefore, if there is a need for it, we can also chunk the retrieval of all event documents by sourceId, for example.

There will be an extra step involved – we will need to gather the list of values for the property we want to chunk the retrieval of events with.

The article Getting unique values of a property outlines how to get the list of unique sourceId in the source store. Similarly we can apply the method to the event document against the sourceId property.

And then we can iterate through each sourceId and submit the above request by replacing “97” with current sourceId in each iteration.

For more details and options try these requests in the API explorer