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

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

This resource supports the following methods: GET, POST

Methods

GET


Retrieves a list of attachments for a particular Automated Test Run's Result Node.

Required Permissions

  • TestManagement/ManageExecutions/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 or the node was not found in the database.

Example - GET

Retrieves a list of attachments for a particular Automated Test Run's result node.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{runId}1459858c-9526-412e-afdd-09415593c2d3The unique identifier (GUID) of the Automated Test Run.
{nodeId}b8166143-c269-4bd8-876e-d2584edc4e2eThe unique identifier (GUID) of the Automated Test Run Result Node.

Response Headers

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

Response Body

[
  {
    "NodeId": "b8166143-c269-4bd8-876e-d2584edc4e2e",
    "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/node/b8166143-c269-4bd8-876e-d2584edc4e2e/attachment/9cb7f1cb-984d-4c47-9275-82d6409ed6be",
    "Content": "http://localhost/api/attachment/9cb7f1cb-984d-4c47-9275-82d6409ed6be/contents"
  },
  {
    "NodeId": "b8166143-c269-4bd8-876e-d2584edc4e2e",
    "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/node/b8166143-c269-4bd8-876e-d2584edc4e2e/attachment/e6040570-48fb-48b4-af1e-fa90fe4ae7dd",
    "Content": "http://localhost/api/attachment/e6040570-48fb-48b4-af1e-fa90fe4ae7dd/contents"
  },
  {
    "NodeId": "b8166143-c269-4bd8-876e-d2584edc4e2e",
    "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/node/b8166143-c269-4bd8-876e-d2584edc4e2e/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's Result Node.

Required Permissions

  • TestManagement/ManageExecutions/ExecuteAllTests
  • TestManagement/ManageExecutions/ExecuteOnlyMyTests

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 or the node 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's result node.

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.
{nodeId}b8166143-c269-4bd8-876e-d2584edc4e2eThe unique identifier (GUID) of the Automated Test Run Result Node.

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