You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: file_operations.yaml
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -117,8 +117,8 @@ paths:
117
117
summary: Get Upload Link
118
118
operationId: getUploadLink
119
119
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**.
122
122
123
123
> 📘 The upload link is only valid for a short time
124
124
>
@@ -160,7 +160,14 @@ paths:
160
160
161
161
## Attach the file/image to a file or image column
162
162
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.
164
171
165
172
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`
166
173
If you are logged in with your browser, you can access this file. Otherwise you will see the login screen.
0 commit comments