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
Copy file name to clipboardExpand all lines: content/developers/api-reference/attachments-api/index.md
+38-78Lines changed: 38 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Assets support attachments by creating an [Asset-Event](/developers/api-referenc
38
38
-`"arc_file_name": "conformance.pdf"`
39
39
-`"arc_display_name": "Conformance Report"`
40
40
41
-
Example of an Asset-event with two attachments:
41
+
An example of an Asset-event with two attachments:
42
42
43
43
```json
44
44
{
@@ -68,15 +68,15 @@ Example of an Asset-event with two attachments:
68
68
}
69
69
```
70
70
71
-
The name of the parent attribute (`"conformance_report"`) can be any value, providing a means to name multiple attachments within a single event, such as the additional `"security_report"` attachment.
71
+
In the above example, the name of the parent attribute (`"conformance_report"`) can be any value, providing a means to name multiple attachments within a single event, such as the additional `"security_report"` attachment.
72
72
73
73
The DataTrails platform evaluates `"arc_attribute_type": "arc_attachment"` to reference a DataTrails [Blob](/developers/api-reference/blobs-api/) based attachment.
74
74
75
-
## Asset-Event Attachment API Examples
75
+
## Create an Asset-Event Based Attachment
76
76
77
-
- 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.
78
-
79
-
- Upload the content of the Attachment using the [Blobs API](/developers/api-reference/blobs-api/).
77
+
-[Create a bearer_token](/developers/developer-patterns/getting-access-tokens-using-app-registrations) and store in a file in a secure local directory with 0600 permissions.
78
+
-[Create an Asset](/developers/api-reference/assets-api/) to associate the attachment.
79
+
- Upload the content of an Attachment using the [Blobs API](/developers/api-reference/blobs-api/).
80
80
81
81
### Asset-Event Attachment Variables
82
82
@@ -101,7 +101,7 @@ The DataTrails platform evaluates `"arc_attribute_type": "arc_attachment"` to re
101
101
ASSET_ID=assets/a1234567-890a
102
102
BLOB_ID=blobs/b1234567-890b
103
103
BLOB_HASH=h1234567h
104
-
BLOB_FILE=conformance.pdf
104
+
BLOB_FILE=cat.jpg
105
105
106
106
### Create an Asset-Event Attachment
107
107
@@ -113,15 +113,15 @@ The DataTrails platform evaluates `"arc_attribute_type": "arc_attachment"` to re
113
113
"operation": "Record",
114
114
"behaviour": "RecordEvidence",
115
115
"event_attributes": {
116
-
"arc_display_type": "Safety Conformance",
117
-
"arc_description": "Safety conformance approved for version 1.6.",
118
-
"conformance_report": {
116
+
"arc_display_type": "Cat-ID",
117
+
"arc_description": "Fydor, the cat on the scene",
118
+
"cat-id": {
119
119
"arc_attribute_type": "arc_attachment",
120
120
"arc_blob_hash_value": "$BLOB_HASH",
121
121
"arc_blob_identity": "$BLOB_ID",
122
122
"arc_blob_hash_alg": "SHA256",
123
123
"arc_file_name": "$BLOB_FILE",
124
-
"arc_display_name": "Conformance Report"
124
+
"arc_display_name": "Fydor"
125
125
}
126
126
}
127
127
}
@@ -147,49 +147,52 @@ The DataTrails platform evaluates `"arc_attribute_type": "arc_attachment"` to re
147
147
"asset_identity": "assets/a1234567-890a",
148
148
"event_attributes": {
149
149
"arc_description": "Safety conformance approved for version 1.6.",
The response will include basic information about the attachment:
195
198
@@ -211,49 +214,6 @@ The response will include basic information about the attachment:
211
214
}
212
215
```
213
216
214
-
### Integrity Protecting External Content
215
-
216
-
To integrity protect content located external to the DataTrails platform, exclude the `"arc_attribute_type": "arc_attachment"`, `"arc_blob_identity"` and `"arc_display_name"` as not being relevant to external content.
217
-
218
-
```json
219
-
cat > /tmp/event.json <<EOF
220
-
{
221
-
"operation": "Record",
222
-
"behaviour": "RecordEvidence",
223
-
"event_attributes": {
224
-
"arc_blob_hash_value": "$BLOB_HASH",
225
-
"arc_blob_hash_alg": "SHA256",
226
-
"arc_file_name": "$BLOB_FILE"
227
-
}
228
-
}
229
-
EOF
230
-
```
231
-
232
-
- Post to the Integrity protected content as an Event:
Copy file name to clipboardExpand all lines: content/developers/api-reference/blobs-api/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The Blobs API enables uploading Binary Large OBjects (BLOBs) such as documents,
18
18
19
19
{{< note >}}
20
20
**Note:** Blobs cannot be searched or listed as a collection using the blobs resource.
21
-
BLobs must be associated with an Asset or Event through an Attachment Attribute and can only be downloaded by users with appropriate access rights to that Attachment.
21
+
Blobs must be associated with an Asset or Event through an Attachment Attribute and can only be downloaded by users with appropriate access rights to that Attachment.
22
22
Take note of the Blob ID returned in the API response, it will be needed for use with Assets and Events.<br>
23
23
For information on Attachments and how to implement them, please refer to [the Events API Reference](../events-api/#adding-attachments).
0 commit comments