Attachments API

Attachments API Reference

Attachment API Examples

Create the bearer_token and store in a file in a secure local directory with 0600 permissions.

Retrieve a Specific Attachment on an Asset

curl -v \
    -H "@$BEARER_TOKEN_FILE" \
    https://app.rkvst.io/archivist/v2/attachments/assets/c04d5ecf-02e0-4be2-a014-ffbbf0e8ddeb/08838336-c357-460d-902a-3aba9528dd22

Retrieve a Specific Attachment on an Event

curl -v \
    -H "@$BEARER_TOKEN_FILE" \
    https://app.rkvst.io/archivist/v2/attachments/assets/c04d5ecf-02e0-4be2-a014-ffbbf0e8ddeb/events/de834094-f6c3-4e38-9b37-8c61dea312c9/08838336-c357-460d-902a-3aba9528dd22

Retrieve Information about a specific Attachment

It’s also possible to retrieve information about specific attachment using this API.

To do that simply issue request as above with a suffix /info

curl -v \
    -H "@$BEARER_TOKEN_FILE" \
    https://app.rkvst.io/archivist/v2/attachments/assets/c04d5ecf-02e0-4be2-a014-ffbbf0e8ddeb/08838336-c357-460d-902a-3aba9528dd22/info

The response will include basic information about the attachment:

{
    "identity": "attachments/08838336-c357-460d-902a-3aba9528dd22",
    "hash": {
        "alg": "SHA256",
        "value": "xxxxxxxxxxxxxxxxxxxxxxx"
    },
    "mime_type": "image/jpeg",
    "timestamp_accepted": "2019-11-07T15:31:49Z",
    "size": 31424
}

Attachment OpenAPI Docs

get  /archivist/v1/attachments/{uuid}

Get an attachment

Description: Returns the attachment associated with the relative resource name

Responses Description
200A successful response.(streaming responses)
401Returned when the user is not authenticated to the system.
403Returned when the user is not authorized to read the attachment.
404Returned when an attachment with the identity does not exist.
defaultAn unexpected error response.

get  /archivist/v1/attachments/{uuid}/info

Get attachment metadata

Description: Gets the metadata associated an attachment uuid

{
  "hash": {
    "alg": "SHA256",
    "value": "717903f32653f07cd895cfe89ca18ff4ca35f825afa7fe17bcb5cb13bf628be0"
  },
  "identity": "attachments/20c97f42-87fc-482c-9d58-4d11abd33359",
  "mime_type": "image/jpeg",
  "size": 1024,
  "timestamp_accepted": "2019-06-22 14:41:32+00:00"
}
Response Parameter Type Description
hash
identity string Relative resource name for the attachment. e.g. attachments/20c97f42-87fc-482c-9d58-4d11abd33359
mime_type string Type of data e.g. image/jpeg
size string Size of blob in bytes
timestamp_accepted string Timestamp of creation
Responses Description
200A successful response.
401Returned when the user is not authenticated to the system.
403Returned when the user is not authorized to read the attachment.
404Returned when an attachment with the identity does not exist.
defaultAn unexpected error response.

Edit this page on GitHub