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: docs/files/file-api.md
+41-5Lines changed: 41 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,50 @@ sidebar_position: 2
10
10
11
11
Files in epilot are uploaded and managed through the [File API](/api/file).
12
12
13
+
## Downloading Files
14
+
15
+
The [`downloadFile` operation](/api/file#tag/files/operation/downloadFile) returns a temporary presigned S3 URL, which the client uses to download a file using the `GET` method.
16
+
17
+
```
18
+
GET https://file.sls.epilot.io/v1/files/4ffdc191-f32c-404a-8520-c403b7408afa/download
The `download_url` in the response is valid for 15 minutes and can be used to download the file using the `GET` method.
28
+
29
+
:::info
30
+
31
+
The `downloadFile` operation requires a valid access token to be present in the request.
32
+
33
+
:::
34
+
35
+
:::note
36
+
37
+
The `public_url` property of a file entity may also be used to download a file directly if the file is public. However the `downloadFile` operation works for both public and private files and is the recommended way to download files.
38
+
39
+
:::
40
+
41
+
13
42
## Uploading Files
14
43
15
-
The `uploadFile` operation returns a temporary presigned S3 URL, which the client uses to upload a file using the `PUT` or `POST` method.
44
+
The [`uploadFile` operation](/api/file#tag/files/operation/uploadFile) returns a temporary presigned S3 URL, which the client uses to upload a file using the `PUT` or `POST` method.
16
45
17
-
After uploading, the client should call the `saveFile` operation to save the uploaded file as an entity make it permanent.
46
+
After uploading, the client should call the [`saveFile` operation](/api/file#tag/files/operation/saveFile) to save the uploaded file as an entity make it permanent.
18
47
19
48
Files that are uploaded but not saved expire and are deleted within 24 hours.
20
49
21
-
## Example Flow
50
+
:::info
51
+
52
+
The `uploadFile` operation requires a valid access token to be present in the request. Use the `uploadFilePublic` operation to upload files for Submissions of public journeys.
53
+
54
+
:::
55
+
56
+
## Example Upload Flow
22
57
23
58
### Step 1: Call uploadFile to receive s3ref
24
59
@@ -118,8 +153,9 @@ You can now attach the returned file entity to any business entity as a relation
118
153
119
154
## Updating Files
120
155
121
-
Modifying or saving new versions of File entities happens via the `saveFile` operation.
156
+
Modifying or saving new versions of File entities happens via the [`saveFile` operation](/api/file#tag/files/operation/saveFile).
157
+
122
158
123
159
## Deleting Files
124
160
125
-
Deleting files is done using the `deleteFile` operation. When the file entity is deleted, the underyling S3 object is deleted permanently.
161
+
Deleting files is done using the [`deleteFile` operation](/api/file#tag/files/operation/saveFile). When the file entity is deleted, the underyling S3 object is deleted permanently.
0 commit comments