{"id":693,"date":"2017-04-21T15:25:34","date_gmt":"2017-04-21T15:25:34","guid":{"rendered":"http:\/\/live.ecd-demo.com\/apihelp\/?page_id=693"},"modified":"2025-07-21T17:37:39","modified_gmt":"2025-07-21T17:37:39","slug":"event-documents","status":"publish","type":"page","link":"https:\/\/apihelp.ecd-demo.com\/index.php\/documentation\/event-documents\/","title":{"rendered":"Event documents"},"content":{"rendered":"<h3>Event store and documents<\/h3>\n<p>Events (schedule or listings) are a collection of documents of type event in the <em>content instance<\/em> store.<\/p>\n<p>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.<\/p>\n<pre><code class=\"swift\">GET https:\/\/&lt;base-url&gt;\/stores-active\/contentinstance\/event\/filter?offset=0&amp;limit=100&amp;api_key=&lt;api-key&gt;\n<\/code><\/pre>\n<p>Increment the <code>offset<\/code> value by 1000 (your <code>limit<\/code> value) for each iteration.<\/p>\n<h4>Chunking by property<\/h4>\n<p>If you understand the relationships between the document types, we know that events are connected to sources. For each <em>event<\/em> there are <code>sourceId<\/code> and <code>source<\/code> properties that identify the source the event is occuring on.<\/p>\n<p>The following will retrieve all the event documents of the source with ID &#8220;<strong>97<\/strong>&#8221;<\/p>\n<pre><code class=\"swift\">GET: https:\/\/&lt;base-url&gt;\/stores-active\/contentinstance\/event\/filter?filter={\"term\":\"sourceId\",\"value\":\"97\"}&amp;api_key=&lt;api-key&gt;\n<\/code><\/pre>\n<h4>Explanation<\/h4>\n<table>\n<thead>\n<tr>\n<th>Paramenter<\/th>\n<th>description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>filter={&#8220;term&#8221;:&#8221;sourceId&#8221;,&#8221;value&#8221;:&#8221;97&#8243;}<\/td>\n<td>filter the response to documents whose sourceId property has the value of &#8220;97&#8221;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Therefore, if there is a need for it, we can also chunk the retrieval of all event documents by <code>sourceId<\/code>, for example.<\/p>\n<p>There will be an extra step involved &#8211; <strong>we will need to gather the list of values for the property we want to chunk the retrieval of events with.<\/strong><\/p>\n<p>The article Getting unique values of a property outlines how to get the list of unique <code>sourceId<\/code> in the source store. Similarly we can apply the method to the event document against the <code>sourceId<\/code> property.<\/p>\n<p>And then we can iterate through each <code>sourceId<\/code> and submit the above request by replacing &#8220;97&#8221; with current <code>sourceId<\/code> in each iteration.<\/p>\n<blockquote><p>For more details and options try these requests in the <a href=\"https:\/\/apihelp.ecd-demo.com\/index.php\/api-explorer\/\">API explorer<\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>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:\/\/&lt;base-url&gt;\/stores-active\/contentinstance\/event\/filter?offset=0&amp;limit=100&amp;api_key=&lt;api-key&gt; Increment the offset value by 1000 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":279,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-693","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages\/693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/comments?post=693"}],"version-history":[{"count":2,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages\/693\/revisions"}],"predecessor-version":[{"id":1513,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages\/693\/revisions\/1513"}],"up":[{"embeddable":true,"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/pages\/279"}],"wp:attachment":[{"href":"https:\/\/apihelp.ecd-demo.com\/index.php\/wp-json\/wp\/v2\/media?parent=693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}