POST: Create an attachment

This topic provides instructions for using the POST operation to add an attachment.

Overview

To create an attachment instance, perform a POST on the attachment collection, passing either:

  • A JSON string

  • An octet-stream

Note: Bulk POSTs are not supported.

Attachments contain two different types of data that can be posted: 

  • The attachment entity details.

  • The attachment’s binary content. The binary content is generally created using client tools or libraries, not using a text editor.

The REST API supports content types of multipart/form-data and octet-stream data.

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.

You can specify a path for the attachment.

Back to top

Flow

  1. Create the attachment outside of OpenText Software Delivery Management using client tools or libraries.

  2. POST the attachment to an entity. The attachment must have an owner, and you specify the owner using an "owner" fields such as owner_work_item or owner_test. For an example, see POST request for json attachments.

  3. Tests: You can associate the attachment with specific test steps. You make this association by updating the test script with a PUT operation. For an example, see POST request of json attachment and PUT request to manual test steps .

Back to top

Examples

Back to top

See also: