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: 225fb9802d5aac3aedf23cd8876a2c6d29e3b6478de335c1bd3ca788fec036ce$$3RXfCVCabLgPELdLgfMoA/+1tvRKvYC7a5qgLWi8U7+EeayPJFw8WmmRoA==--x2Zrnp8c8m0byE+2--390j/ee+YAXO4TY5KLba3w==
Api-Key: 1xV8DkzstcUbtbGG

Body

{
  "scan": {
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "file_key": "JQ5S555DHhnPzhHdJufcv1Bs",
        "thumbnail_key": "ZHSqevAvuy31cD1NRnmKGGNv",
        "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-06-18T22:04:35.299Z",
    "updated_at": "2019-06-18T22:04:35.299Z",
    "uid": "8Foo7Acj",
    "team_uid": "aFi2K9Q1",
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "created_at": "2019-06-18T22:04:35.301Z",
        "updated_at": "2019-06-18T22:04:35.301Z",
        "publicly_visible": true,
        "publicly_downloadable": true,
        "metadata": {
          "foo": "bar"
        },
        "kind": "kind",
        "uid": "DwSGaCi7",
        "scan_uid": "8Foo7Acj",
        "file_key": "JQ5S555DHhnPzhHdJufcv1Bs",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBhdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--890544ec96bf378508a03d35917a4402e615bde8/test.json",
        "thumbnail_key": "ZHSqevAvuy31cD1NRnmKGGNv",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBhZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--4a4d41088083261039d9d863407dc71e1ad39ebb/test.json",
        "annotation_type_list": [

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