operation and behaviour detail what class of Event is being performed. By default this should always be Record and RecordEvidence, respectively.
In the attributes section you should also add the required DataTrails attributes arc_description and arc_display_type to represent Event Description and Event Type.
---steps:- step:action:EVENTS_CREATEdescription:Record event against My First Container.asset_label:assets/<asset-id> operation:Recordbehaviour:RecordEvidenceevent_attributes:arc_description:Inspection Eventarc_display_type:Inspection
Fill out metadata about your Event; operation and behaviour detail what class of Event is being performed. By default this should always be Record and RecordEvidence, respectively.
In the attributes section you should also add the required DataTrails attributes arc_description and arc_display_type to represent Event Description and Event Type.
This Event will be POSTed to a specific Asset endpoint when the curl command is run. To do this, you will need the desired assets/<asset-id> string.
You may enter both Event and Asset attributes
Event Attributes - Attributes specific to an Event, i.e. which device recorded the Event Asset Attributes - Attributes of the Asset that may change as a result of the Event, i.e. overall weight of a container
Select the Add Attribute button on each tab to add your key-value pairs. You may also add an attachment to your Event. Select the symbol to upload a file. In this case, we will attach a PDF document labeled Inspection Standards.
Add your event_attributes and asset_attributes as key-value pairs. You may also add an attachment to your Event. In this case, we have attached a PDF document labeled Inspection Standards
---steps:- step:action:EVENTS_CREATEdescription:Record event against My First Container.asset_label:assets/<asset-id>operation:Recordbehaviour:RecordEvidenceevent_attributes:arc_description:Inspection Eventarc_display_type:InspectionCargo:Rare Metalsasset_attributes:Weight:"1192kg"attachments:- filename:inspection_standards.pdfcontent_type:document/pdfdisplay_name:Inspection Standardsconfirm:true
You may add an attachment to your Event. To do so you will need to upload your attachment to DataTrails using the
Blobs API.
Add your event_attributes and asset_attributes as key-value pairs. Use the blobs/<attachment-id> returned from the curl command above as the arc_attachment_identity in your Event.
Here we see someone noted the type of cargo loaded in the Event, and recorded the total weight of the cargo using a newly defined Weight attribute.
Every Event has an automatically generated timestamp_accepted and principal_accepted attribute that records when who performed what, as submitted to DataTrails.
There is an option to append timestamp_declared and principal_declared attributes on the Event, for example, if the Event happened offline or a third party reports it. This creates a more detailed record.
PDFs or images can be recorded with an Event in the same way as an Asset. This is useful for storing associated material for posterity. For example, each Inspection Event can store the PDF document of a specific standard for container inspection. This allows historical compliance checking of Events.
Record your Event
Once you have entered all data, click the Record Event Button to add to your Asset.
The EVENTS_LIST action can be used to view all Events, or filtered using attributes (attrs) to view details of a specific Event
To view all Events, use:
---steps:- step:action:EVENTS_LISTdescription:List all events.print_response:true
To view the details of the Event you just created for My First Container, use:
---steps:- step:action:EVENTS_LISTdescription:List inspection Events against the Asset 'My First Container'.print_response:trueasset_label:assets/<asset-id>attrs:arc_display_type:Inspectionasset_attrs:arc_display_type:Shipping Container
Event data can be viewed using curl commands
To view all Events across all Assets, use:
curl -v -X GET \
-H "@$HOME/.datatrails/bearer-token.txt"\
https://app.datatrails.ai/archivist/v2/assets/-/events
To view the details of the Event you just created for My First Container, use:
curl -v -X GET \
-H "@$HOME/.datatrails/bearer-token.txt"\
https://app.datatrails.ai/archivist/v2/assets/<asset-id>/events/<event-id>
Please see the
Administration section for information on how to manage your assets
In the next section we look at a specific type of Asset, the Document Profile Asset.