You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* AB#10424 update docs with events /search endpoint
* spelling and formatting
* Complete formatting and examples for baseline filtering and paging of events
Co-authored-by: steve lasker <[email protected]>
Signed-off-by: steve lasker <[email protected]>
@@ -31,12 +31,6 @@ To minimize the impact, prior to switching to Asset-free Events, it is recommend
31
31
32
32
## Events API Examples
33
33
34
-
{{< note >}}
35
-
**Note:** If you are looking for a simple way to test DataTrails APIs you might prefer the [Postman collection](https://www.postman.com/datatrails-inc/workspace/datatrails-public/overview), the [YAML runner](/developers/yaml-reference/story-runner-components/) or the [Developers](https://app.datatrails.ai) section of the web UI.
36
-
37
-
Additional YAML examples can be found in the articles in the [Overview](/platform/overview/introduction/) section.
38
-
{{< /note >}}
39
-
40
34
### Event Creation
41
35
42
36
- Create the [bearer_token](/developers/developer-patterns/getting-access-tokens-using-app-registrations) and store in a file in a secure local directory with 0600 permissions.
@@ -157,14 +151,11 @@ To associate an Attachment with an Event, see the [Attachments API](/developers/
157
151
158
152
Event records in DataTrails are assigned UUIDs at creation time and referred to in all future API calls by a their unique identity in the format: `events/<event-id>`
159
153
160
-
{{< note >}}
161
-
**Note:** The current preview limits fetching Events to the Event identity.
162
-
Querying across event attributes and trails are coming in a future preview.
163
-
{{< /note >}}
154
+
## Fetch Events by Identity
164
155
165
-
#### Fetch Events by Identity
166
-
167
-
- Replace the `<event-id>` below, using the event-id from the created event above: `"identity": "events/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"`:
156
+
- Replace the `<event-id>` below, using the event-id from the created event above.
Use `top` and `skip` alongside `x-total-count` response header to navigate results.
259
+
If sum of `skip` and number of results in response is less than the count of all results (`x-total-count` in the response header) there are more results to retrieve.
260
+
To get the next set of results, re-issue the `/search` request with `skip` increased by number of results in current response.
261
+
262
+
If `x-total-count` response header has value greater than 2 (as indicated by value of `top` in `search.json`) modify `search.json` to the following:
263
+
264
+
```bash
265
+
cat > /tmp/search.json <<EOF
266
+
{
267
+
"filter": "",
268
+
"top": 2,
269
+
"skip": 2
270
+
EOF
271
+
```
272
+
273
+
- Post to the `/events/search/` endpoint to retrieve another page of results, repeating this process until `skip` + number or results in the response is equal to `x-total-count`.
0 commit comments