Skip to content

Commit 7a26d08

Browse files
authored
Update docs with new event repsponse shape (#992)
Update docs with new event repsponse shape AB#10264
1 parent 8d95309 commit 7a26d08

1 file changed

Lines changed: 35 additions & 21 deletions

File tree

  • content/developers/api-reference/events-api

content/developers/api-reference/events-api/index.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ To minimize the impact, prior to switching to Asset-free Events, it is recommend
3939
```bash
4040
cat > /tmp/event.json <<EOF
4141
{
42-
"trails": ["Safety Conformance", "Clouseau"],
42+
"trails": ["Clouseau"],
4343
"attributes": {
4444
"arc_display_type": "Safety Conformance",
4545
"Safety Rating": "90",
4646
"inspector": "Clouseau"
47-
}
47+
},
48+
"event_type": "Safety Conformance"
4849
}
4950
EOF
5051
```
@@ -71,9 +72,9 @@ To minimize the impact, prior to switching to Asset-free Events, it is recommend
7172
"Safety Rating": "90"
7273
},
7374
"trails": [
74-
"Safety Conformance",
7575
"Clouseau"
7676
],
77+
"event_type": "Safety Conformance",
7778
"origin_tenant": "tenant/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
7879
"created_by": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
7980
"created_at": 1736421833577,
@@ -117,7 +118,7 @@ Events can use the [Blobs API](/developers/api-reference/blobs-api/) to associat
117118
```json
118119
cat > /tmp/event.json <<EOF
119120
{
120-
"trails": ["Safety Conformance", "Clouseau"],
121+
"trails": ["Clouseau"],
121122
"attributes": {
122123
"arc_primary_image": {
123124
"arc_attribute_type": "arc_attachment",
@@ -127,7 +128,8 @@ Events can use the [Blobs API](/developers/api-reference/blobs-api/) to associat
127128
"arc_blob_hash_alg": "SHA256",
128129
"arc_file_name": "$BLOB_FILE"
129130
}
130-
}
131+
},
132+
"event_type": "Safety Conformance",
131133
}
132134
EOF
133135
```
@@ -177,23 +179,29 @@ Event records in DataTrails are assigned UUIDs at creation time and referred to
177179
```bash
178180
cat > /tmp/search.json <<EOF
179181
{
180-
"filter": "",
182+
"filter": "trails/any(t: t eq 'Clouseau') and event_type eq 'Safety Conformance'",
181183
"top": 20,
182184
"skip": 0
183185
}
184186
EOF
185187
```
186188
187189
where:
188-
`filter` = attribute name/value pairs
190+
`filter` = [OData filter](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31360955) expression currently following properties of event are filterable:
191+
* trails eg. `trails/any(t: t eq 'Clouseau')`
192+
* event_type eg. `event_type eq 'Safety Conformance'`
193+
* origin_tenant eg. `origin_tenant eq 'tenant/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'`
194+
* created_by eg. `created_by eq 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'`
195+
* created_at eg. `created_at gt '1736421833577'`
196+
* ledger_entry/index eg. `ledger_entry/index lt 123`
197+
* ledger_entry/idtimestamp eg. `ledger_entry/idtimestamp eq '0196cf103fe5064c00'`
198+
* ledger_entry/content_hash eg. `ledger_entry/content_hash eq '0e9ba3f1815fe893bab3ece6b5e396e8e804ee57061239fbee7b497d94b24ee8'`
199+
200+
currently following operands are supported: `eq, ne, gt, ge, lt, le` and following logical operators `and, or, not`
201+
189202
`top` = number of results to return (max. 50) and
190203
`skip` = how many results to skip over before returning set of results
191204
192-
{{< note >}}
193-
**Note:** The current preview does not support filtering of Events.
194-
Filtering across event attributes and trails are coming in a future preview.
195-
{{< /note >}}
196-
197205
- Post `search.json` to the `/search` endpoint:
198206
199207
```bash
@@ -217,16 +225,19 @@ Event records in DataTrails are assigned UUIDs at creation time and referred to
217225
"Safety Rating": "90"
218226
},
219227
"trails": [
220-
"Safety Conformance",
221228
"Clouseau"
222229
],
230+
"event_type": "Safety Conformance",
223231
"origin_tenant": "tenant/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
224232
"created_by": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
225233
"created_at": 1736421833577,
226234
"confirmation_status": "STORED",
227-
"merklelog_commit": {
228-
"index": "0",
229-
"idtimestamp": ""
235+
"ledger_entry": {
236+
"index": "16",
237+
"idtimestamp": "0196cf103fe5064c00",
238+
"content_hash": "0e9ba3f1815fe893bab3ece6b5e396e8e804ee57061239fbee7b497d94b24ee8",
239+
"hash_schema": "v0",
240+
"log_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
230241
}
231242
},
232243
{
@@ -237,16 +248,19 @@ Event records in DataTrails are assigned UUIDs at creation time and referred to
237248
"Safety Rating": "99"
238249
},
239250
"trails": [
240-
"Safety Conformance",
241251
"Clouseau"
242252
],
253+
"event_type": "Safety Conformance",
243254
"origin_tenant": "tenant/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
244255
"created_by": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
245256
"created_at": 1736421873579,
246257
"confirmation_status": "STORED",
247-
"merklelog_commit": {
248-
"index": "0",
249-
"idtimestamp": ""
258+
"ledger_entry": {
259+
"index": "8",
260+
"idtimestamp": "0196c9448b6d064c00",
261+
"content_hash": "791a76d42f7f07470f91226b7eb38645182afe2d4b2114ab52fc6dc4f9dd0260",
262+
"hash_schema": "v0",
263+
"log_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
250264
}
251265
}
252266
]
@@ -264,7 +278,7 @@ Event records in DataTrails are assigned UUIDs at creation time and referred to
264278
```bash
265279
cat > /tmp/search.json <<EOF
266280
{
267-
"filter": "",
281+
"filter": "trails/any(t: t eq 'Clouseau') and event_type eq 'Safety Conformance'",
268282
"top": 2,
269283
"skip": 2
270284
EOF

0 commit comments

Comments
 (0)