Attachments

POST /scans/:uid/attachments

Endpoint

POST /api/v2/scans/:uid/attachments

Parameters

Name Description type
uid required Scan uid string
attachment[kind] Kind string
attachment[metadata] Attachment metadata string
attachment[publicly_downloadable] Publicly downloadable boolean
attachment[publicly_visible] Publicly visible boolean
attachment[file_key] required Direct upload file key string
attachment[thumbnail_key] Direct upload thumbnail key string

Request

Route

POST /api/v2/scans/EVViiHZL/attachments

Headers

Accept: application/json
Content-Type: application/json
Access-Token: 2517bcd9b5b28a7e0a0f69320ae95f088670025e940f2bb107cdc6980aca35e6$$whOJ8D5tqzGRSQlEsxxa+6XyXmLopTKRLaDBdZOS9YV9iTWm+o2Y6XOFlg==--L7KWuJ7Q1sPEG0Ld--P2YM8SHV4vnWypJbcctx0A==
Api-Key: 123abc

Body

{
  "attachment": {
    "kind": "identifier",
    "metadata": {
      "foo": "bar"
    },
    "file_key": "h3FkV8fzQDKEqSiorGb6Xh8U",
    "thumbnail_key": "9y1ijwCcG6AJ6Wc2NGY8Ep5W"
  }
}

Response

Status

201

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "scan": {
    "created_at": "2019-08-05T22:48:26.110Z",
    "updated_at": "2019-08-05T22:48:26.110Z",
    "uid": "EVViiHZL",
    "team_uid": "1edNJ47Z",
    "tag_list": [

    ],
    "attachments": [
      {
        "created_at": "2019-08-05T22:48:26.343Z",
        "updated_at": "2019-08-05T22:48:26.343Z",
        "publicly_visible": false,
        "publicly_downloadable": false,
        "metadata": {
          "foo": "bar"
        },
        "kind": "identifier",
        "uid": "K5dWDVcc",
        "scan_uid": "EVViiHZL",
        "file_key": "h3FkV8fzQDKEqSiorGb6Xh8U",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBcllGIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--3b5ff12e87d592ed2aa6e68513eadf5f59fa3c39/test.json",
        "thumbnail_key": "9y1ijwCcG6AJ6Wc2NGY8Ep5W",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBclVGIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--32efffb38f4d8fc391f3f240b54ded857ab4cc70/test.json",
        "annotation_type_list": [

        ],
        "team_uid": "1edNJ47Z",
        "collection_uid": null
      }
    ]
  },
  "success": true
}