@@ -16,206 +16,6 @@ externalDocs:
16
16
description : Find out more about the Oxen project
17
17
url : http://oxen.io
18
18
paths :
19
- /room/{roomToken}/file :
20
- post :
21
- tags : [Files]
22
- summary : " Uploads a file to a room."
23
- description : >
24
- Takes the request as binary in the body and takes other properties via submitted headers.
25
- This saves space, particularly for large uploads. The user must have upload and posting
26
- permissions for the room. The file will have a default lifetime of 1 hour, but that is
27
- extended to 15 days when the containing message referencing the uploaded file is posted.
28
-
29
-
30
- See also the `.../fileJson` endpoint for submitting via a json body.
31
- parameters :
32
- - $ref : " #/components/parameters/pathRoomToken"
33
- - name : X-Filename
34
- in : header
35
- description : >
36
- Suggested filename of the upload. Typically the basename of the file uploaded from the
37
- user.
38
- schema :
39
- type : string
40
- requestBody :
41
- description : The file content, in bytes.
42
- required : true
43
- content :
44
- ' */* ' :
45
- {}
46
- responses :
47
- 200 :
48
- description : successful operation
49
- content :
50
- application/json :
51
- schema :
52
- type : object
53
- properties :
54
- id :
55
- type : integer
56
- format : int64
57
- description : " The id of the file on the server."
58
- 403 :
59
- description : >
60
- Upload forbidden. This response code indicates that the user does not have posting
61
- and/or upload permissions in the room either because of room settings, user restriction,
62
- or because the user is banned.
63
- content :
64
- application/json :
65
- schema :
66
- type : object
67
- properties :
68
- banned :
69
- type : boolean
70
- description : >
71
- True if the upload was denied because the user is banned, omitted otherwise.
72
- noWrite :
73
- type : boolean
74
- description : >
75
- True if the upload was denied because the user does not have write access to
76
- the room (but is not banned). Omitted otherwise.
77
- noUpload :
78
- type : boolean
79
- description : >
80
- True if the upload was denied because the user does not have upload access to
81
- the room (but is not banned and has write permissions). Omitted otherwise.
82
-
83
- /room/{roomToken}/fileJSON :
84
- post :
85
- tags : [Files]
86
- summary : " Uploads a file to a room using a JSON encoded body."
87
- description : >
88
- This is less efficient when a binary upload is possible because the body must be passed as
89
- base64-encoded data (which is 33% larger). The user must have upload and posting
90
- permissions for the room. [NOT YET IMPLEMENTED: The file will have a default lifetime of 1
91
- hour, but that is extended to 15 days when the containing message referencing the upload
92
- is submitted.]
93
- parameters :
94
- - $ref : " #/components/parameters/pathRoomToken"
95
- requestBody :
96
- required : true
97
- content :
98
- application/json :
99
- schema :
100
- type : object
101
- required : [filename, content]
102
- properties :
103
- filename :
104
- type : string
105
- description : " Suggested filename of the upload. Typically the basename of the file uploaded from the user."
106
- content :
107
- type : string
108
- format : byte
109
- description : The file content, in base64 encoding.
110
- responses :
111
- 200 :
112
- $ref : " #/paths/~1room~1%7BroomToken%7D~1file/post/responses/200"
113
- 403 :
114
- $ref : " #/paths/~1room~1%7BroomToken%7D~1file/post/responses/403"
115
-
116
- /room/{roomToken}/file/{fileId} :
117
- get :
118
- tags : [Files]
119
- summary : " Retrieves a file from the room via JSON."
120
- description : >
121
- Retrieves a file via a fileId from the room via a JSON object response. This is noticeably
122
- less efficient (particularly for large files) than the binary version when making direct
123
- requests because the file data must be encoded using base64 encoding.
124
- parameters :
125
- - $ref : " #/components/parameters/pathRoomToken"
126
- - $ref : " #/components/parameters/pathFileId"
127
- responses :
128
- 200 :
129
- description : successful operation; returns the file in JSON.
130
- content :
131
- application/json :
132
- schema :
133
- type : object
134
- properties :
135
- filename :
136
- type : string
137
- description : >
138
- The suggested filename of the file. Omitted if the file was uploaded without a
139
- filename (e.g. from older clients, or clients that specify an empty filename.)
140
- size :
141
- type : integer
142
- format : int64
143
- description : >
144
- The file size, in bytes. (*Not* the length of the base64-encoded data.)
145
- uploaded :
146
- type : number
147
- format : double
148
- description : The unix timestamp when the file was uploaded.
149
- expires :
150
- type : number
151
- format : double
152
- nullable : true
153
- description : >
154
- The unix timestamp when the file is scheduled to be removed. Will be null if
155
- the attachment is permanent, such as for room images or attachments in pinned
156
- messages.
157
- 403 :
158
- $ref : " #/paths/~1room~1%7BroomToken%7D/get/responses/403"
159
- 404 :
160
- description : >
161
- The referenced file does not exist. (It may have expired, or may be invalid.)
162
-
163
- /room/{roomToken}/file/{fileId}/{filename} :
164
- get :
165
- tags : [Files]
166
- summary : " Retrieves a file from the room as binary."
167
- description : >
168
- Retrieves a file via a fileId from the room, returning the file content directly as the
169
- binary response body. The filename parameter is ignored and may be empty: it is primarily
170
- included to aid in clients that want the request to include a filename, and differentiates
171
- this as a request retrieving the file itself rather than the file as a JSON response. See
172
- the version without `/filename` for a JSON-returning version.
173
- parameters :
174
- - $ref : " #/components/parameters/pathRoomToken"
175
- - $ref : " #/components/parameters/pathFileId"
176
- - name : filename
177
- in : path
178
- required : true
179
- description : >
180
- Filename if known by the requesting client, and empty otherwise. The value of this
181
- parameter is ignored by the server itself: it is included to differentiate this request
182
- from the JSON version, and so that clients may include a filename in the request URL for
183
- contexts where that is useful.
184
- schema :
185
- type : integer
186
- format : int64
187
- responses :
188
- 200 :
189
- description : successful operation; returns the file, in raw bytes.
190
- headers :
191
- Content-Length :
192
- description : The size of the file.
193
- schema :
194
- type : integer
195
- format : int64
196
- example : 12345
197
- Date :
198
- description : The HTTP timestamp at which the file was uploaded.
199
- schema :
200
- type : string
201
- example : " Thu, 7 Oct 2021 00:42:00 GMT"
202
- Expires :
203
- description : >
204
- The HTTP timestamp at which the file is scheduled to expire. This header is omitted
205
- if the attachment is non-expiring (e.g. for attachments in a pinned message [NOT YET
206
- IMPLEMENTED]).
207
- schema :
208
- type : string
209
- example : " Fri, 22 Oct 2021 00:42:42 GMT"
210
- content :
211
- application/octet-stream :
212
- schema :
213
- type : string
214
- format : binary
215
- 403 :
216
- $ref : " #/paths/~1room~1%7BroomToken%7D~1file~1%7BfileId%7D/get/responses/403"
217
- 404 :
218
- $ref : " #/paths/~1room~1%7BroomToken%7D~1file~1%7BfileId%7D/get/responses/404"
219
19
/user/{sessionId}/permission :
220
20
post :
221
21
tags : [Users]
0 commit comments