Skip to content

Commit efe39b2

Browse files
committed
Improve getUploadLink/uploadFile docs
1 parent 1b3bdbe commit efe39b2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

file_operations.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ paths:
117117
summary: Get Upload Link
118118
operationId: getUploadLink
119119
description: |
120-
With the **API token** (not the Base Token), you can generate an upload link, the parent- and the relative path. These information are needed to upload a file / an image to a bases.
121-
Then this file/image can be attached to a file/image column.
120+
Generate an upload link, including the parent- and the relative path. These values are needed in order to [upload a file / an image](https://api.seatable.com/reference/uploadfile) to a base.
121+
Afterwards, this file/image can be attached to a file/image column. Please note that this endpoint requires an **API token** instead of a **Base token**.
122122
123123
> 📘 The upload link is only valid for a short time
124124
>
@@ -160,7 +160,14 @@ paths:
160160
161161
## Attach the file/image to a file or image column
162162
163-
After uploading the file/image to a base, SeaTable saves the uploaded file at non-public URL in the form: `/workspace/{workspace_id}`+`parent_dir`+`relative_path`+`name`.
163+
After uploading the file/image to a base, SeaTable saves the uploaded file at non-public URL in the form: `/workspace/{workspace_id}`+`parent_dir`+`relative_path`+`name`.
164+
You are expected to construct this relative URL yourself.
165+
166+
The URL consists of the following components:
167+
- `workspace_id`: Each base is attached to a workspace. You can use the [Get Base-Token with API-Token](https://api.seatable.com/reference/getbasetokenwithapitoken) endpoint to retrieve the workspace ID for a base.
168+
- `parent_dir`: Use the value of the `parent_path` field from the response of the [Get Upload Link](https://api.seatable.com/reference/getuploadlink) API call.
169+
- `relative_path`: Use the value of the `img_relative_path` or `file_relative_path` field (depending on the type of asset you want to upload) from the response of the [Get Upload Link](https://api.seatable.com/reference/getuploadlink) API call.
170+
- `name`: Use the value of the `name` field from the response of the [Upload File (or Image)](https://api.seatable.com/reference/uploadfile) API call.
164171
165172
Here is an example how this might look like: `https://cloud.seatable.io/workspace/24/asset/55f2f056-5da1-4095-b5f8-791bb51b991e/images/2023-07/party.png`
166173
If you are logged in with your browser, you can access this file. Otherwise you will see the login screen.

0 commit comments

Comments
 (0)