Scans

POST /scans

Upon successful file upload via a POST to /direct_uploads, a scan record may be created by passing the key returned from each direct upload as either the file_key or thumbnail_key of each file to be associated with the scan.

Endpoint

POST /api/v2/scans

Parameters

Name Description type
scan[attachments][][file_key] required Direct upload file key string
scan[attachments][][thumbnail_key] Direct upload thumbnail key string
scan[attachments][][kind] Kind string
scan[tag_list] Array of tag strings array
scan[attachments][][metadata] File metadata json
scan[attachments][][publicly_downloadable] Publicly downloadable boolean
scan[attachments][][publicly_visible] Publicly visible boolean
scan[attachments] required Array of objects containing above parameters array

Request

Route

POST /api/v2/scans

Headers

Accept: application/json
Content-Type: application/json
Access-Token: d08deefaca4a177414fb706e2eb6a0ad4863fd15ce8b2c2a08003ca368442a43$$xcNP/H8VQDBdiKLsCIlU67p4uWffUBnr3qYmfMCEs1qpc+nAVUYezX6MHg==--qUIp30lpBIyfF0Bm--AePa2yowKB6NNAqU8VnTcg==
Api-Key: krzy3JVziupAhG47

Body

{
  "scan": {
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "file_key": "ANP9eUtXC4UfN3WJEtLaMN59",
        "thumbnail_key": "BRQbWRbzTEcGDgvXu2pNJCKo",
        "kind": "kind",
        "publicly_downloadable": true,
        "publicly_visible": true,
        "metadata": {
          "foo": "bar"
        }
      }
    ]
  }
}

Response

Status

201

Headers

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

Body

{
  "scan": {
    "created_at": "2019-11-20T21:13:20.481Z",
    "updated_at": "2019-11-20T21:13:20.481Z",
    "uid": "2aXVo4Kn",
    "team_uid": "MUPptRJp",
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "created_at": "2019-11-20T21:13:20.482Z",
        "updated_at": "2019-11-20T21:13:20.482Z",
        "publicly_visible": true,
        "publicly_downloadable": true,
        "metadata": {
          "foo": "bar"
        },
        "kind": "kind",
        "uid": "Zr9GaMba",
        "scan_uid": "2aXVo4Kn",
        "file_key": "ANP9eUtXC4UfN3WJEtLaMN59",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBa29UIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--d367900954c6bd206a06c1475d2676e86f7e01f1/test.json",
        "thumbnail_key": "BRQbWRbzTEcGDgvXu2pNJCKo",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBa2tUIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--aa9f583c1e48baa6fd395e807918d1aa5fa86e54/test.json",
        "annotation_type_list": [

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