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/Rx9UrPyh/attachments

Headers

Accept: application/json
Content-Type: application/json
Access-Token: f3eb777df6270dd43f232ed7fdb87bd4537f16a83a1d58bbefcab607eff0e2d5$$LUngKvlcFAU6IkWMhrF2awNYHxyg2QLdo9imwNthgVw7hn7Rg0TY1qjrDg==--bVMq3kZ9KJbPo9F6--r9Y/RtOALSCFkphDD/w+Dw==
Api-Key: 123abc

Body

{
  "attachment": {
    "kind": "identifier",
    "metadata": {
      "foo": "bar"
    },
    "file_key": "DYYFHfn7TSnnKgthmCvrjZ2E",
    "thumbnail_key": "WC6xsNBq5gfXFxH7TaSKocYK"
  }
}

Response

Status

201

Headers

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

Body

{
  "scan": {
    "created_at": "2019-06-18T22:04:28.424Z",
    "updated_at": "2019-06-18T22:04:28.424Z",
    "uid": "Rx9UrPyh",
    "team_uid": "2ym9GSch",
    "tag_list": [

    ],
    "attachments": [
      {
        "created_at": "2019-06-18T22:04:28.653Z",
        "updated_at": "2019-06-18T22:04:28.653Z",
        "publicly_visible": false,
        "publicly_downloadable": false,
        "metadata": {
          "foo": "bar"
        },
        "kind": "identifier",
        "uid": "hPqo8vqH",
        "scan_uid": "Rx9UrPyh",
        "file_key": "DYYFHfn7TSnnKgthmCvrjZ2E",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBaZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--519fcbc308c125e37887b8f218d646f038467f86/test.json",
        "thumbnail_key": "WC6xsNBq5gfXFxH7TaSKocYK",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBaUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--30940663e1dae0ab8d16acb47ffed97f0d2bef96/test.json",
        "annotation_type_list": [

        ],
        "team_uid": "2ym9GSch",
        "collection_uid": null
      }
    ]
  },
  "success": true
}