ALM 12.5x REST API Reference
Attachments

An attachment is a file that is associated with another resource, such as a defect.

Remarks

Attachments are specified by their numerical ID. The file name cannot be used as the attachment ID. To get a file by name, use a query. See the example under Query Parameters.

The query parameter by-id is not valid.

To GET the binary file content, use header Accept: application/octet-stream.

To GET the binary file content and the meta-data, use header Accept: multipart/mixed.

Example of return value using header Accept: multipart/mixed

To POST a new file, use header content-type: multipart/form-data header.

The body of the POST request has these parts:

Post example:

URIs

/qcbin/api/domains/{domain}/projects/{project}/attachments

/qcbin/api/domains/{domain}/projects/{project}/attachments/{ID}

Limitations

Header Parameters

Query Parameters

The valid query parameters are:

For a GET operation, if the file name is used in a filter, the entity.type and entity.id parameters are required. More than one entity.id can be specified.

Example: /qcbin/api/domains/my-domain/projects/my-project/attachments/?query={entity.type[requirement];entity.id[2 or 4];name[my-file.txt]}

Header Parameters

Returns

GET with an Accept header of application/json returns a descriptor of the attachment entity.

GET with an Accept header of application/octet-stream, returns the file. The Content-Type header reflects the type of file.

See Return Values

See Also

Working_With