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/1UehuhLW/attachments

Headers

Accept: application/json
Content-Type: application/json
Access-Token: 12e5677db6c3d2e46086afa7a59914f2933abead1a36fabf13d8c5656e334ffa$$ahim1h81THxi2A9ndea5QY6Mu920uZoU/IpnWIiALKxFc+SD/S2wXa+EJQ==--RHyNYPxFD5wDmudE--Nws0ThJ7r74NrHbD28gbKw==
Api-Key: 123abc

Body

{
  "attachment": {
    "kind": "identifier",
    "metadata": {
      "foo": "bar"
    },
    "file_key": "tzpYrKh3CBiSF4iHb7zknE1J",
    "thumbnail_key": "YEHXVjYJXLi8UMjJ9tkCaxmx"
  }
}

Response

Status

201

Headers

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

Body

{
  "scan": {
    "created_at": "2019-03-22T22:35:53.514Z",
    "updated_at": "2019-03-22T22:35:53.514Z",
    "uid": "1UehuhLW",
    "team_uid": "JgE7bi3b",
    "tag_list": [

    ],
    "attachments": [
      {
        "created_at": "2019-03-22T22:35:53.743Z",
        "updated_at": "2019-03-22T22:35:53.743Z",
        "publicly_visible": false,
        "publicly_downloadable": false,
        "metadata": {
          "foo": "bar"
        },
        "kind": "identifier",
        "uid": "iwgBLxt9",
        "scan_uid": "1UehuhLW",
        "file_key": "tzpYrKh3CBiSF4iHb7zknE1J",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaFlCIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--6f3a940e8c06159836e9ee68f05a282487b25718/test.json",
        "thumbnail_key": "YEHXVjYJXLi8UMjJ9tkCaxmx",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaFVCIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5142725ba7c8ebcf36c66c605ad6cf4586a604f9/test.json",
        "annotation_type_list": [

        ],
        "team_uid": "JgE7bi3b",
        "collection_uid": null
      }
    ]
  },
  "success": true
}