Attachments

The attachments resource, unlike others, represents both entity data and binary content.

Overview

  • Attachments currently are supported only in the workspace context (as the entity metadata reflects).

  • The attachments API provides generic access for all attachments in the workspace. As a result, for each entity that has the attachments feature, the attachment entity has a reference field to the entity.

  • The reference field names adhere to the following convention:

    owner_<entity name>

    Example: owner_test

  • The attachment entity must have a reference to only one owner entity.

  • ALM Octane supports the following file types:

    jpg bmp png
    word doc docx
    msg pdf xml
    xls xlsx ppt
    pptx zip txt
    wmv mp4 m4p
    mkv vob log
    wrf fbr jpeg

    Customize the supported file types by modifying the ATTACHMENTS_FILE_EXTENSION_WHITE_LIST configuration parameter. For details, see Set configuration parameters (technical preview).

    The REST API checks that the file extension matches the binary content format. If the extension and the content format do not match, the attachment is not uploaded.

    When supplying the attachment name in the request, extra spaces at the beginning or at the end of the file name are trimmed, and do not cause any errors.

Attachment collection

In some of the HTTP methods, resource collection behaves as any other collection entity, representing only the attachment entity data without the binary content. In other HTTP methods, there is reference to binary content.

URI

Attachments are relevant only in the workspace context:

.../api/shared_spaces/<space_id>/workspaces/<workspace_id>/attachments

Note: For the syntax for specifying parameters in URIs, see Variables and values.

Supported HTTP request methods

The attachment collection supports the following HTTP methods:

Method

Description

GET

Retrieve data about the attachment, or the actual attachment.

POST

Create new attachments in a collection.

PUT

Update information about the attachment (not the binary data).

DELETE

Delete existing attachments.

Note: To update an actual attachment (the binary data), DELETE the original attachment and POST a new one.

Actions on attachment collections

Back to top

Attachment instance

The attachment instance contains both the attachment’s entity data and the binary content.

Supported HTTP request methods

The attachment instance supports the following HTTP methods:

Method

Description

GET

Retrieve data about the attachment, or the actual attachment.

POST

Create new attachments in a collection.

PUT

Update information about the attachment (not the binary data).

Only the attachment’s entity data can be updated.

DELETE

Delete existing attachments.

Note: To update an actual attachment (the binary data), DELETE the original attachment and POST a new one in the collection.

Actions on attachment instances

Back to top

See also: