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/6eWi9mXR/attachments

Headers

Accept: application/json
Content-Type: application/json
Access-Token: 1f317f88b02e11458c0e1b313f97ad999813d76b0a6d501b52b63b0d2340134d$$BW4h3B5F7zO4krlNtuoi40S/36yZjbnlP7OmIQlPMegh5+oia5M/IG9DUA==--q68jCCxolUJJVh0o--Z8HBwELzStRRKK+8gwOsVg==
Api-Key: 123abc

Body

{
  "attachment": {
    "kind": "identifier",
    "metadata": {
      "foo": "bar"
    },
    "file_key": "TrxZp2gYFiPQhTjBnsDYVkHY",
    "thumbnail_key": "UQ7z9rxZ9KVXSBAWTW3UYvUr"
  }
}

Response

Status

201

Headers

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

Body

{
  "scan": {
    "created_at": "2020-06-01T21:44:42.312Z",
    "updated_at": "2020-06-01T21:44:42.312Z",
    "uid": "6eWi9mXR",
    "team_uid": "yJ6k6Eea",
    "tag_list": [

    ],
    "attachments": [
      {
        "created_at": "2020-06-01T21:44:42.429Z",
        "updated_at": "2020-06-01T21:44:42.429Z",
        "publicly_visible": false,
        "publicly_downloadable": false,
        "metadata": {
          "foo": "bar"
        },
        "kind": "identifier",
        "uid": "e2V7J19L",
        "scan_uid": "6eWi9mXR",
        "file_key": "TrxZp2gYFiPQhTjBnsDYVkHY",
        "file_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBcDhCIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--9ee6d776ab465dd340b6237d3486d2df4818c526/test.json",
        "thumbnail_key": "UQ7z9rxZ9KVXSBAWTW3UYvUr",
        "thumbnail_url": "http://localhost:3002/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBcDRCIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--1ea1b45d61ceb42f214a9a0bbc67f78f41f70ff8/test.json",
        "annotation_type_list": [

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