Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel7
minLevel1

POST /files

Parameters

Parameter

Type

Description

file

Binary

File content

meta.category

String

File category. This is to mark the usage of the attachments. For now the possible reasons are 'intake_attachment', 'user_consent', 'user_avatar', 'user_document'

X-ApiToken

String

The token of the user who is uploading the file. They will be considered the file owner.

Intake_attachment file type - these are per-visit files and will only be visible on the visit page.

User_document file type - these files (documents) are per user profile, they will be visible for patients under Documents page and providers also can view it on the patient’s page under Documents tab.

Response

Code Block
curl -X POST \
  https://apivclinic.vseevseepreview.iocom/ccvc/ligengstable/api_v3/files \
  -H 'X-ApiToken: 4df5b2b7dec8a8c40e142e43c1825502' \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F file=@/Users/teligeng/Pictures/p878984.jpg \
  -F meta.category=user_document

{
    "data": {
        "id": "5e15d150-19b4-4cbd-b217-332fc71b6977",
        "name": "p878984.jpg",
        "size": 40679,
        "ext": "jpg",
        "fullpath": "https://apivclinic.vseevseepreview.iocom/ccvc/ligengstable/files/view/5e15d150-19b4-4cbd-b217-332fc71b6977?auth_code=e86ceb8b57c91e4db41611f08311a125e2df0b09&time=1578488144",
        "meta": {
            "category": "user_document",
            "target": {
                "id": "350936",
                "type": "user"
            },
            "account": {
                "code": "5c47c63907c44f0486a16e1dc71b6977"
            }
        },
        "creator": {
            "id": "350936",
            "username": "ligeng+trial14+member01@vseelab.com",
            "email": "ligeng+trial14+member01@vseelab.com",
            "full_name": "Ligeng Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Name"
        }
    }
}

...

Modify the document information. For now, only 'name' is allowed to be modified.

Parameters

Parameter

Type

Description

name

String

File name

Response

Code Block
languagejson
curl -X POST \
  https://apivclinic.vseevseepreview.iocom/ccvc/ligengstable/api_v3/files/5e1598e7-4118-47ca-84da-0923c71b6977 \
  -H 'X-ApiToken: 466c809667919d34d371d4c7d389392b' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F name=test2.jpg

{
    "data": {
        "id": "5e1598e7-4118-47ca-84da-0923c71b6977",
        "name": "test2.jpg",
        "size": 184259,
        "ext": "jpg",
        "fullpath": "https:\/\/apivclinic.vseevseepreview.iocom\/ccvc\/ligengstable\/files\/view\/5e1598e7-4118-47ca-84da-0923c71b6977?auth_code=ed7e17f29a56cc8c4b2fec812a07e7d30f322b85&time=1579496452",
        "meta": {
            "target": {
                "id": "350936",
                "type": "user"
            },
            "category": "user_document",
            "account": {
                "code": "5c47c63907c44f0486a16e1dc71b6977"
            }
        },
        "created": 1578473704
    }
}

DELETE /files/:id

Parameters

Parameter

Type

Description

id

String

File id

Response

Code Block
languagejson
curl -X DELETE -H "X-ApiToken: c18e9874dccd26482e191f3d7b57d3d8" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "file=@" "https://api.vsee.me/api_v3/files/57aa6ede-bf6c-4a88-81e1-6bcdac1f0144" -k

{
    "data": true
}

...

Retrieve file list

Parameters

Parameter

Type

Description

target_id

String

The id of the target which is related to the files. Should be equal to user_id if target_type is user or visit_id if target_type is visit.

target_type

String user | visit

The file of the target which is related to the files. For now the possible values are 'user' and 'visit'

category_type

String

The category type of this file. For now the possible reasons are 'user_document', 'intake_attachment', 'user_consent', 'user_avatar'.

include_shared

Boolean true|false

Include this param will get all the files that tagged user_document and notes files that shared to the user.

Response

wide
Code Block
breakoutMode
languagejson
curl --location --request GET \
> 'https://api-vclinic.vsee.me/api_v3/files?target_id=2317820300&target_type=user' \
> --header 'X-AccountCode: vclinic' --header 'X-ApiToken: vclinic_api_key'

{
    "data": [
        {
            "created": 1657668358,
            "creator": {
                "full_name": "Patient's Name",
                "type": 200,
                "username": "62ce09a2940adc6474"
            },
            "ext": "pdf",
            "fullpath": "https://api-vclinic.vsee.me/files/view/62ce0306-bd68-8fj3-7771-6dfc0ks8219474?auth_code=bb7e2d413f9jd93unf92u4e35584d10&time=1669924552",
            "id": "62ce0306-bd68-8fj3-7771-6dfc0ks8219474",
            "is_deletable": true,
            "meta": {
                "account": {
                    "code": "vclinic"
                },
                "category": "user_document",
                "target": {
                    "id": "2317820300",
                    "type": "user"
                },
                "visible": true
            },
            "name": "2017-01-21 04:00:00 - filename.pdf",
            "size": 274988
        }
    ]
}

GET /files/:id

Retrieve file info including the download link.

Parameters

Parameter

Type

Description

:id

String

File id. E.g. _id from Intake attachments array, etc.

Response

Code Block
languagejson

curl -X GET "https://api-vclinic.vsee.me/api_v3/files/63f67f95-41f8-4581-bdc3-792f0adc0a9f" -k

{
    "data": {
        "id": "57e8c9a2-5c30-4b2c-b9d0-11d6ac1f0144",
        "name": "Screenshot 2023-02-22 at 21.47.43.png",
        "size": 25473,
        "ext": "png",
        "fullpath": "https://api-vclinic.vsee.me/files/view/57e8c9a2-5c30-4b2c-b9d0-11d6ac1f0144?auth_code=01f72b633c40c73a87f1bc66694ee31&time=1677099046",
        "meta": {
            "target": {
                "id": "63f67fb0-9864-4059-ad1b-63b10adc6474",
                "type": "intake"
            },
            "category": "intake_attachment",
            "account": {
                "code": "vclinic"
            }
        },
        "creator": {
            "username": "anton+test2@vseelab.com",
            "type": 200,
            "full_name": "anton test_2",
            "id": "27769243"
        },
        "created": 1677098901,
        "is_deletable": false,
        "modified": 1677098901
    }
}

data.fullpath - the link to download the file (see https://developers.vsee.com/wiki/spaces/VD/pages/15302716/File+Upload+API#GET-/files/view/:id )

GET /files/view/:id

Download the file itself.

Parameters

Parameter

Type

Description

:id

String

File id. E.g. _id from Intake attachments array, etc.

auth_code

String

Auth code returned by other API method

time

String

Timestamp as returned by other API method

size

String

(optional) Resized image dimensions in {W}x{H} format. Example: 320x240. If the file is not image, this parameter will be ignored. Resized Image is always PNG format, Content-type: image/png header will be set in response

Response

Code Block
languagejson
curl -X GET "https://api-vclinic.vsee.me/api_v3/files/57e8c9a2-5c30-4b2c-b9d0-11d6ac1f0144?auth_code=01f72b633c40c9c272f9dc73a87f1bc66694ee31&time=1475236382&size=320x480" -k

Binary object

...