Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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'

Response

curl -X POST \
  https://api.vsee.io/cc/ligeng/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://api.vsee.io/cc/ligeng/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"
        }
    }
}

POST /files/:id

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

Parameters

Parameter

Type

Description

name

String

File name

Response

curl -X POST \
  https://api.vsee.io/cc/ligeng/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:\/\/api.vsee.io\/cc\/ligeng\/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

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
}

GET /files

Retrieve file list

Parameters

Parameter

Type

Description

target_id

String

The id of the target which is related to the files

target_type

String

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'.

Response

curl -X GET \
>   'https://api.vsee.io/cc/ligeng/api_v3/files?target_id=350936&target_type=user' \
>   -H 'X-ApiToken: 4df5b2b7dec8a8c40e142e43c1825502' \
>   -H 'cache-control: no-cache' \
>   -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
>   -F target_id=350936 \
>   -F target_type=user


{
    "data": [
        {
            "id": "5e1598e7-4118-47ca-84da-0923c71b6977",
            "name": "55bb223fd7304.jpg",
            "size": 184259,
            "ext": "jpg",
            "fullpath": "https:\/\/api.vsee.io\/cc\/ligeng\/files\/view\/5e1598e7-4118-47ca-84da-0923c71b6977?auth_code=ede418b2b0b1fa5451c726a7e6959b2efabcad97&time=1578530083",
            "creator": {
                "username": "ligeng+trial14+member01@vseelab.com",
                "type": 200,
                "full_name": "Ligeng Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Name"
            },
            "created": 1578473704
        }
    ]
}

GET /files/:id

Retrieve file info

Parameters

Parameter

Type

Description

:id

String

File id

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

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

Binary object

  • No labels