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: 9e2355908980c2ee0074491ea6ef29d05eed2ce15400c3d988072a8366542c1d$$c8d/UmF83k77IM3K33s3kAFOXHUA97arWxWNG2ZzauhZiLkSP4pav+R/jw==--CGyRElUxZE8ZHRJ+--uMOc7fb0ST8QO27KeCU47w==
Api-Key: 4PsqLUVGMmzEud5M

Body

{
  "scan": {
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "file_key": "dGeM1DmEdHdMXAxhMAosGz1d",
        "thumbnail_key": "myKRwr4hA5deAdb3rkDveB6z",
        "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-08-05T22:48:35.054Z",
    "updated_at": "2019-08-05T22:48:35.054Z",
    "uid": "4vftmYrf",
    "team_uid": "podxeZG7",
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "created_at": "2019-08-05T22:48:35.055Z",
        "updated_at": "2019-08-05T22:48:35.055Z",
        "publicly_visible": true,
        "publicly_downloadable": true,
        "metadata": {
          "foo": "bar"
        },
        "kind": "kind",
        "uid": "AxcJLoAf",
        "scan_uid": "4vftmYrf",
        "file_key": "dGeM1DmEdHdMXAxhMAosGz1d",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBcnNGIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--aa7e8c82b5dd5d43ef5692d410b4830193276530/test.json",
        "thumbnail_key": "myKRwr4hA5deAdb3rkDveB6z",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBcm9GIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--6af21ca80f39cda00874f1a49fde5892d600fd79/test.json",
        "annotation_type_list": [

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