-
Notifications
You must be signed in to change notification settings - Fork 3
/
api-description.yaml
202 lines (200 loc) · 6.25 KB
/
api-description.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
openapi: "3.0.3"
info:
title: "Cryptify API"
description: "This is the cryptify server that manages encrypted files."
version: "1.0.0"
tags:
- name: "File upload"
description: "Upload files"
- name: "File download"
description: "Download files"
paths:
/fileupload/init:
post:
tags:
- "File upload"
summary: "Initialize multipart file upload"
operationId: "initFileUpload"
requestBody:
content:
application/json:
schema:
type: "object"
properties:
sender:
type: "string"
format: "email"
recipient:
type: "string"
format: "email"
fileSize:
type: "number"
mailContent:
type: "string"
mailLang:
type: "string"
responses:
"200":
description: "Successful operation"
headers:
cryptifytoken:
description: "Identifies the initial version of the file to be uploaded. Needs to be passed into the file part upload request."
required: true
schema:
type: "string"
content:
application/json:
schema:
type: "object"
properties:
id:
type: "string"
format: "uuid"
/fileupload/{uuid}:
put:
tags:
- "File upload"
summary: "Upload a file part"
operationId: "uploadFilePart"
parameters:
- in: "header"
name: "cryptifytoken"
description:
"Identifies the version of the upload file parts. Part of the header from the last fileupload response."
schema:
type: "string"
required: true
- in: "header"
name: "Content-Range"
description:
"Which offset of a file is sent, example: `bytes 200-1000/*`."
schema:
type: "string"
required: true
- in: "path"
name: "uuid"
required: true
description: "The unique identifier received when initializing file upload."
schema:
type: "string"
format: "uuid"
requestBody:
content:
application/octet-stream:
schema:
type: "string"
format: "binary"
responses:
"200":
description: "Successful operation."
headers:
cryptifytoken:
required: true
schema:
description: "Identifies the new version of the upload file parts. Needs to be passed into the next file part upload request."
type: "string"
"409":
description: "Server file parts cryptifytoken differs from cryptifytoken in request."
headers:
cryptifytoken:
required: true
schema:
description:
"Identifies the version of the upload file parts. Needs to be passed into the next file part upload request."
type: "string"
"400":
description: "One of the input parameters is incorrect."
content:
application/json:
schema:
type: "object"
properties:
message:
type: "string"
"404":
description: "Partially uploaded file does not exist."
/fileupload/finalize/{uuid}:
post:
tags:
- "File upload"
summary: "Finalize multipart file upload and send mail to recipient"
operationId: "finalizeFileUpload"
parameters:
- in: "header"
name: "cryptifytoken"
description:
"Identifies the version of the upload file parts. Part of the header from the last fileupload response."
schema:
type: "string"
required: true
- in: "header"
name: "Content-Range"
description:
"Indicates the final file size: `bytes */1073741824`."
schema:
type: "string"
required: true
- in: "path"
name: "uuid"
description: "The unique identifier received when initializing file upload."
required: true
schema:
type: "string"
format: "uuid"
responses:
"200":
description: "Successful operation"
"409":
description: "Server file parts cryptifytoken differs from cryptifytoken in request"
headers:
cryptifytoken:
required: true
schema:
description: "Identifies the version of the upload file parts. Needs to be passed into the next file part upload request."
type: "string"
"400":
description: "One of the input parameters is incorrect."
content:
application/json:
schema:
type: "object"
properties:
message:
type: "string"
"404":
description: "Partially upload file does not exist."
"422":
description: "Data is missing to form complete file."
/filedownload/{uuid}:
get:
tags:
- "File download"
summary: "Download a file"
operationId: "downloadFile"
parameters:
- in: "path"
name: "uuid"
required: true
description: "The unique identifier received when initializing file upload."
schema:
type: "string"
format: "uuid"
responses:
"200":
description: "Successful operation."
content:
application/cryptify+octet-stream:
schema:
type: "string"
format: "binary"
"400":
description: "One of the input parameters is incorrect."
content:
application/json:
schema:
type: "object"
properties:
message:
type: "string"
"404":
description: "Uploaded file does not exist."