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: 045c66833163e77120d40031c4185e4785e67667a852213658c6f57840bdacea$$QZy2SlDMb/kW3uWHGDwg4ozca9gxUDtWiXhN0400LM8q7nY4htOVWjmF7Q==--0L/LfSDE6bHzgTps--+jqlKqfwazpurMo64c3qqA==
Api-Key: aXZT2zKjqdRrhq1e

Body

{
  "scan": {
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "file_key": "ho5VmDWuEvQJvWMdUeZKbBFs",
        "thumbnail_key": "HTRCSTMb4ot8efsasG5dYE7K",
        "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-03-15T05:01:18.234Z",
    "updated_at": "2019-03-15T05:01:18.234Z",
    "uid": "uAbRa21X",
    "team_uid": "LYFyrv8f",
    "tag_list": [
      "foo",
      "bar"
    ],
    "attachments": [
      {
        "created_at": "2019-03-15T05:01:18.235Z",
        "updated_at": "2019-03-15T05:01:18.235Z",
        "publicly_visible": true,
        "publicly_downloadable": true,
        "metadata": {
          "foo": "bar"
        },
        "kind": "kind",
        "uid": "HS1KTrav",
        "scan_uid": "uAbRa21X",
        "file_key": "ho5VmDWuEvQJvWMdUeZKbBFs",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBZQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--a4308206461b215b621ad2c18357e7c29013d361/test.json",
        "thumbnail_key": "HTRCSTMb4ot8efsasG5dYE7K",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBYdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5274711d482200a3ca6a75cf4e4bd9a4db27400b/test.json",
        "annotation_type_list": [

        ],
        "team_uid": "LYFyrv8f"
      }
    ]
  },
  "success": true
}