-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
245 lines (245 loc) · 7.36 KB
/
openapi.yml
File metadata and controls
245 lines (245 loc) · 7.36 KB
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
openapi: 3.0.0
info:
description: API for sending and receiving documents between DMSs (Document Management System).
version: 1.0.0
title: Doc Integration API
contact:
email: hello@ykjam.tm
license:
name: MIT
paths:
/api/document/receive:
post:
tags:
- Inter-organization
summary: Receive document from another organization
parameters:
- in: header
name: "X-Organization"
description: "organization name, must exactly match the one in registry"
required: true
schema:
type: string
example: Edara 1
- in: header
name: "X-Signature"
description: |
signature for the current document (all info about document and the file itself should be signed). RSA PKCS #1 v1.5 with SHA256 hash function. `EncodeBase64(SignPKCS1v15(private_key, Hash(data, hash_type.SHA_256), hash_type.SHA_256))`
required: true
schema:
type: string
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/DocumentReceiveRequest'
required: true
responses:
'200':
description: Document received successfully
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
'400':
description: Provided request data is not valid
content:
application/json:
schema:
$ref: '#/components/responses/error_not_found_response'
'403':
description: Forbidden, invalid signature
content:
application/json:
schema:
$ref: '#/components/responses/error_unathorized_response'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/responses/error_server_error_response'
components:
schemas:
DocumentReceiveRequest:
properties:
file:
type: string
format: binary
description: document file itself
example: document file binary
json:
$ref: '#/components/schemas/DocumentReceiveJson'
DocumentReceiveJson:
description: JSON encoded data about document
properties:
sender_type:
type: string
enum:
- individual
- legal_entity
example: individual
exit_date:
type: integer
description: time in epoch, without time zone, int64
example: 1587634067
exit_no:
type: string
example: H4/253
sender:
type: string
example: Edara
receiver:
type: string
example: Edara (receiving)
sign_name:
type: string
description: Name of the person who signed the document
example: A.Amanow
sign_position:
type: string
description: Position of the person who signed the document
example: Başlyk
exec_name:
type: string
description: Name of the person who prepared the document
example: Hünärmen
nullable: true
exec_contact:
type: string
description: Contacts of the person who prepared the document
example: '99312123456'
nullable: true
description:
type: string
example: Tender barada
file:
type: string
example: filename.pdf
forwarded:
type: boolean
description: was that document forwarded to us?
example: true
forward_meta:
type: array
description: metadata of forward history
items:
type: object
properties:
sender_org:
type: string
example: Edara
sender_name:
type: string
example: M.Mekanow
sender_position:
type: string
example: Başlygyň orunbasary
receiver_org:
type: string
example: Edara (kabul edýän)
exit_no:
type: string
description: exit_no of OUT document created for forwarding
example: H/32
exit_date:
type: integer
description: time in epoch, without time zone, int64
example: 1587634067
message:
type: string
example: Bellenen tertipde seretmegiňizi haýyş edýärin
create_ts:
type: integer
description: time in epoch, without time zone, int64
example: 1587634067
nullable: true
SuccessResponse:
properties:
success:
type: boolean
example: true
ErrorResponse:
properties:
success:
type: boolean
example: false
responses:
success_response:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
error_bad_input_response:
description: Bad input
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_not_found_response:
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_forbidden_response:
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_invalid_response:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_server_error_response:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_unathorized_response:
description: Unathorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_too_large_response:
description: Entity too large
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_conflict_response:
description: 'Conflict, already exists on server'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_user_banned_response:
description: 'Too many otp attempts. User blocked'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_many_requests_response:
description: 'Too many otp attempts.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_tfa_response:
description: TFA required
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
error_expired_response:
description: TFA expired
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'