Resource: Automated Test Run Attachments ( /api/automatedtestrun/{runId}/attachments )

A collection resource representing the attachments of an Automated Test Run.

This resource supports the following methods: GET, POST

Methods

GET


Retrieves a list of attachments for a particular Automated Test Run.

Required Permissions

  • TestManagement/View

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if ET could not complete the request (normally due to a validation failure or the necessary permissions to complete the request have not been met).
404 - NotFoundReturned if the ID for the run was not found in the database.

Example - GET

Retrieves a list of attachments for a particular Automated Test Run.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{runId}1459858c-9526-412e-afdd-09415593c2d3The unique identifier (GUID) of the Automated Test Run.

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

[
  {
    "RunId": "1459858c-9526-412e-afdd-09415593c2d3",
    "Id": "9cb7f1cb-984d-4c47-9275-82d6409ed6be",
    "Name": "File 1",
    "FileName": "File 1.txt",
    "ContentType": "text/plain",
    "CreatedAt": "2013-02-01T11:00:00Z",
    "CreatedById": "89fda208-2f7a-42e9-8d0a-3518b80b0765",
    "Size": 111,
    "Self": "http://localhost/api/automatedtestrun/1459858c-9526-412e-afdd-09415593c2d3/attachment/9cb7f1cb-984d-4c47-9275-82d6409ed6be",
    "Content": "http://localhost/api/attachment/9cb7f1cb-984d-4c47-9275-82d6409ed6be/contents"
  },
  {
    "RunId": "1459858c-9526-412e-afdd-09415593c2d3",
    "Id": "e6040570-48fb-48b4-af1e-fa90fe4ae7dd",
    "Name": "File 2",
    "FileName": "File 2.txt",
    "ContentType": "text/plain",
    "CreatedAt": "2013-02-01T11:00:00Z",
    "CreatedById": "89fda208-2f7a-42e9-8d0a-3518b80b0765",
    "Size": 148,
    "Self": "http://localhost/api/automatedtestrun/1459858c-9526-412e-afdd-09415593c2d3/attachment/e6040570-48fb-48b4-af1e-fa90fe4ae7dd",
    "Content": "http://localhost/api/attachment/e6040570-48fb-48b4-af1e-fa90fe4ae7dd/contents"
  },
  {
    "RunId": "1459858c-9526-412e-afdd-09415593c2d3",
    "Id": "72d41457-1840-4a86-8080-788f3d974ba6",
    "Name": "File 3",
    "FileName": "File 3.txt",
    "ContentType": "text/plain",
    "CreatedAt": "2013-02-01T11:00:00Z",
    "CreatedById": "89fda208-2f7a-42e9-8d0a-3518b80b0765",
    "Size": 185,
    "Self": "http://localhost/api/automatedtestrun/1459858c-9526-412e-afdd-09415593c2d3/attachment/72d41457-1840-4a86-8080-788f3d974ba6",
    "Content": "http://localhost/api/attachment/72d41457-1840-4a86-8080-788f3d974ba6/contents"
  }
]

Status Code

200 - OK

POST


Adds a new attachment to a particular Automated Test Run.

Required Permissions

  • TestManagement/ManageExecution

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
201 - CreatedReturned if the request was completed successfully.
403 - ForbiddenReturned if ET could not complete the request (normally due to a validation failure or the necessary permissions to complete the request have not been met).
404 - NotFoundReturned if the ID for the run was not found in the database.
415 - UnsupportedMediaTypeReturned if the request is not mime multipart.

Example - POST

Adds a new attachment to a particular Automated Test Run.

Request Headers

KeyValueDescription
Content-Typemultipart/mixed; boundary=65bf6b94-c91c-442c-abe7-f41444d7c71f

Request Parameters

KeyValueDescription
{runId}1459858c-9526-412e-afdd-09415593c2d3The unique identifier (GUID) of the Automated Test Run.

Request Body

--65bf6b94-c91c-442c-abe7-f41444d7c71f
Content-Disposition: attachment; filename=screenshot1.png; name="screenshot 1"; size=122454
Content-Type: image/png
Content-Length: 3
...
--65bf6b94-c91c-442c-abe7-f41444d7c71f
Content-Disposition: attachment; filename=notes.txt; name=notes; size=3
Content-Type: text/plain
Content-Length: 3
ABC
--65bf6b94-c91c-442c-abe7-f41444d7c71f--

Response Headers

KeyValueDescription
Locationhttp://localhost/api/automatedtestrun/1459858c-9526-412e-afdd-09415593c2d3/attachmentsThe location of the new attachment resource

Status Code

201 - Created

  • No labels