Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleGET /api/v1/attachments/{attachmentId}
Panel

Get an attachment


Request

PARAMETERS

parameter

type

description

attachmentIdString

- id of the attachment to get.


Example:
Tip
titleExample Request

curl -H "Content-Type: application/json" -X GET -H "Authorization: Bearer $token" https://xray.cloud.xpand-itgetxray.comapp/api/v1/attachments/7e0073ec-cc9a-44fa-a2da-9d8c163caeae

Responses

200 OK : octet/stream : Successful. The attachment is retrieved.

400 BAD_REQUEST : application/json : The attachment could not be retrieved.
Example Output

{
    "error": "No such file"
}



401 UNAUTHORIZED: application/json:
The API token is invalid.

...

Expand
titlePOST /api/v1/attachments
Panel
borderColor#ccc
borderStylesolid

Add attachment

Request

Example

Tip
titleExample Request

curl -H "Content-Type: multipart/form-data" -X POST -F attachment=@report.pdf -H "Authorization: Bearer $token" https://xray.cloud.xpand-itgetxray.comapp/api/v1/attachments

Responses

200 OK : application/json : Successful. The attachment was added.

Code Block
titleExample Output
{
  "id": "7e0073ec-cc9a-44fa-a2da-9d8c163caeae",
  "filename": "report.pdf",
  "created": "2020-06-28T16:59:33.051Z",
  "size": 123446
}


400 BAD_REQUEST : application/json : The attachment information was not provided.

Code Block
titleExample Output
{
  "error": "No file found."
}


401 UNAUTHORIZED : application/json : The Xray license is not valid.