-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
522 lines (522 loc) · 15.9 KB
/
openapi.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
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
openapi: 3.0.0
info:
title: OnBase Document API
description: Wrapper API of Hyland RESTful OnBase Document API
version: v2
license:
name: GNU Affero General Public License Version 3
url: http://www.gnu.org/licenses/agpl-3.0.en.html
contact:
name: IS Data Architecture Team
url: https://is.oregonstate.edu/data-architecture
email: isdataarchitecture@oregonstate.edu
externalDocs:
description: GitHub Repository
url: https://github.com/osu-mist/onbase-docs-api
servers:
- url: https://api.oregonstate.edu/v2
security:
- OAuth2:
- full
paths:
/onbase-docs/documents:
get:
summary: Get documents
tags:
- documents
description: Get documents. At most 100 results will be retrieved.
operationId: getDocuments
parameters:
- name: filter[documentTypeName]
in: query
required: true
description: The name of the document type to store the document into
example: 'PAR PAR Form'
schema:
type: string
- name: filter[keywordTypeNames]
in: query
required: false
description: >-
The keyword Type names in pipe-delimited format. The order must match with
filter[keywordValues].
schema:
type: array
items:
type: string
minItems: 0
style: pipeDelimited
explode: false
example: keyword_name_1|keyword_name_2
- name: filter[keywordValues]
in: query
required: false
description: >-
The keyword values in pipe-delimited format. The order must match with
filter[keywordTypeNames].
schema:
type: array
items:
type: string
minItems: 0
style: pipeDelimited
explode: false
example: keyword_value_1|keyword_value_2
- name: filter[startDate]
in: query
required: false
description: The starting date of the date range
schema:
type: string
format: date
example: '2020-01-01'
- name: filter[endDate]
in: query
required: false
description: The end date of the date range
schema:
type: string
format: date
example: '2021-12-31'
responses:
'200':
description: Document fetched successfully
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentSetResult'
'400':
$ref: '#/components/responses/400'
'500':
$ref: '#/components/responses/500'
post:
summary: Upload document
tags:
- documents
description: Upload document
operationId: postDocument
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
uploadedDocument:
type: string
format: binary
description: Update document
documentTypeId:
type: string
description: The ID of the document type to store the document into
example: '1234'
indexKey:
type: string
description: The index key for performing autofill document keywords
example: '1234'
required:
- uploadedDocument
- documentTypeId
- indexKey
additionalProperties: false
responses:
'201':
description: Document uploaded
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentResult'
'400':
$ref: '#/components/responses/400'
'413':
$ref: '#/components/responses/413'
'500':
$ref: '#/components/responses/500'
/onbase-docs/documents/{documentId}:
get:
summary: Get document metadata by document ID
tags:
- documents
description: Gets document metadata by document ID
operationId: getDocumentById
parameters:
- $ref: '#/components/parameters/documentId'
responses:
'200':
description: Get document metadata successfully
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentResult'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
/onbase-docs/documents/{documentId}/keywords:
get:
summary: Get keywords for an indexed document
tags:
- keywords
description: Gets the keyword values for a document grouped by keyword type group and keyword type
operationId: getDocumentKeywords
parameters:
- $ref: '#/components/parameters/documentId'
responses:
'200':
description: Document keyword fetched successfully
content:
application/json:
schema:
$ref: '#/components/schemas/KeywordsResult'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
patch:
summary: Sets all keyword values for an indexed document
tags:
- keywords
description: Sets all keyword values for an indexed document. Existing values will be replaced with the supplied list of keyword values grouped by keyword type group and keyword type
operationId: patchDocumentKeywords
parameters:
- $ref: '#/components/parameters/documentId'
requestBody:
required: true
content:
application/json:
schema:
type: object
description: Instance data for keywords on a document
properties:
keywords:
type: array
items:
properties:
typeId:
type: string
description: The unique identifier of the keyword type for this keyword value
example: '123'
values:
type: array
description: A List of keyword values that contain various formats of the keyword value
items:
type: object
properties:
value:
type: string
description: Value of keyword
example: '933012347'
required:
- typeId
- values
additionalProperties: false
responses:
'200':
description: Document keyword updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/KeywordsResult'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
/onbase-docs/documents/{documentId}/content:
get:
summary: Get document content
tags:
- document-content
description: Get document content for a rendition of a revision
operationId: getDocumentContent
parameters:
- $ref: '#/components/parameters/documentId'
responses:
'200':
description: Document keyword fetched successfully
content:
'*/*':
schema:
type: string
format: binary
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
/onbase-docs/document-types:
get:
summary: Get document types
tags:
- document-types
description: Get document types
operationId: getDocumentTypes
parameters:
- name: filter[documentTypeName]
in: query
required: true
description: The name of the document type to store the document into
example: 'PAR PAR Form'
schema:
type: string
responses:
'200':
description: Document uploaded
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentTypeSetResult'
'400':
$ref: '#/components/responses/400'
'500':
$ref: '#/components/responses/500'
/onbase-docs/document-types/{documentTypeId}:
get:
summary: Get document type by ID
tags:
- document-types
description: Get document type by ID
operationId: getDocumentTypeById
parameters:
- $ref: '#/components/parameters/documentTypeId'
responses:
'200':
description: Document uploaded
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentTypeResult'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
components:
securitySchemes:
OAuth2:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://api.oregonstate.edu/oauth2/token
scopes:
full: Full access to the API
parameters:
documentId:
name: documentId
in: path
description: The unique identifier of a document
required: true
schema:
type: string
documentTypeId:
name: documentTypeId
in: path
description: The unique identifier of a document type
required: true
schema:
type: string
responses:
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResult'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResult'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResult'
'413':
description: Payload Too Large
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResult'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResult'
schemas:
SelfLink:
properties:
self:
type: string
format: uri
description: Self-link of current resource
DocumentResource:
properties:
id:
type: string
description: The unique identifier of a document
type:
type: string
enum:
- documents
links:
$ref: '#/components/schemas/SelfLink'
attributes:
type: object
properties:
name:
type: string
description: Name of the file
example: 'Sample file name'
documentTypeId:
type: string
description: The ID of the document type to store the document into
example: '1234'
createdByUserId:
type: string
description: The unique identifier of the user that created this document
example: '123456'
storedDate:
type: string
format: date-time
description: The date/time this document was stored
example: '2017-07-21T17:32:28Z'
status:
type: string
description: The document status of Active, Deleted or Inactive
enum:
- Active
- Deleted
- Inactive
documentDate:
type: string
format: date
description: The document date
example: '2017-07-21'
KeywordsResource:
properties:
id:
type: string
description: The unique identifier of a document keywords. It's as same as the document ID
type:
type: string
enum:
- keywords
links:
$ref: '#/components/schemas/SelfLink'
attributes:
type: object
properties:
keywords:
type: array
items:
properties:
typeId:
type: string
description: The unique identifier of the keyword type for this keyword value
example: '123'
name:
type: string
description: The name of the keyword type
example: DOC - General Info
values:
type: array
items:
type: object
properties:
value:
type: string
description: Value of keyword
example: '933012347'
formattedValue:
type: string
description: Formatted value of keyword
example: '933012347'
DocumentTypeResource:
properties:
id:
type: string
description: The unique identifier of a document type
type:
type: string
enum:
- document-types
links:
$ref: '#/components/schemas/SelfLink'
attributes:
type: object
properties:
name:
type: string
description: Name of the document type
example: 'PAR PAR Form'
documentTypeGroupId:
type: string
description: The ID of the document type group
example: '1234'
DocumentResult:
properties:
links:
$ref: '#/components/schemas/SelfLink'
data:
$ref: '#/components/schemas/DocumentResource'
DocumentSetResult:
type: object
properties:
links:
$ref: '#/components/schemas/SelfLink'
data:
type: array
items:
$ref: '#/components/schemas/DocumentResource'
KeywordsResult:
properties:
links:
$ref: '#/components/schemas/SelfLink'
data:
$ref: '#/components/schemas/KeywordsResource'
DocumentTypeResult:
properties:
links:
$ref: '#/components/schemas/SelfLink'
data:
$ref: '#/components/schemas/DocumentTypeResource'
DocumentTypeSetResult:
type: object
properties:
links:
$ref: '#/components/schemas/SelfLink'
data:
type: array
items:
$ref: '#/components/schemas/DocumentTypeResource'
ErrorObject:
properties:
status:
type: string
description: HTTP status code
example: '123'
title:
type: string
description: A short, user readable summary of the error
example: Not Found
code:
type: string
description: An application-specific error code
example: '1234'
detail:
type: string
description: A long description of the error that may contain instance-specific
details
links:
properties:
about:
type: string
format: uri
description: A link to further information about the error
example: https://developer.oregonstate.edu/documentation/error-reference#1234
ErrorResult:
properties:
errors:
type: array
items:
$ref: '#/components/schemas/ErrorObject'