generated from peter-evans/swagger-github-pages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
382 lines (370 loc) · 12.2 KB
/
swagger.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
openapi: 3.0.0
info:
description: |
Welcome to the Lawlift API! You can use our API to access Lawlift API endpoints to export data from your system into Lawlift.
### Authentication
Lawlift uses API keys to allow access to the API.
Lawlift expects the API key to be included in all API requests to the server in the request header in the following form:
```Authorization: Bearer API_KEY```
You must replace API_KEY with your personal API key.
The API Auth key can be retrieved from the Lawlift app. Open a Template in editing mode, choose Options and enable the 'API Mapping'. The API key will be displayed unencrypted below.
NOTE: The API auth key will be in the form: \<ApiClientId>@\<ApiSecretKey>
version: "1.2.0"
title: "Lawlift API"
termsOfService: "https://www.lawlift.com/privacy"
contact:
email: [email protected]
servers:
# Added by API Auto Mocking Plugin
#- description: SwaggerHub API Auto Mocking
# url: https://virtserver.swaggerhub.com/sarasate/APIv1/1.0.0
# Added by API Auto Mocking Plugin
# - description: SwaggerHub API Auto Mocking
# url: https://virtserver.swaggerhub.com/sarasate/APIv1/1.0.0
- url: "https://app.lawlift.de/api/v1"
# - url: 'http://localhost:3000/api/v1'
tags:
- name: documents
description: Generate a document in the Lawlift app with imported data
- name: templates
description: Endpoints for templates
- name: publications
description: Endpoints for publications
paths:
/publications/documents/generate:
post:
tags:
- publications
description: Generate a document for a publication
responses:
"200":
description: Returns a link to a generated document based on a publication
content:
application/json:
schema:
type: string
example: "https://app.lawlift.de/publications/document/YSHqK23Y7RGAtFHB6/yfoDmbuHp5TiQgEfb"
requestBody:
$ref: "#/components/requestBodies/PublicationDocument"
/publications/documents/generate/secret-url:
post:
tags:
- publications
description: Generate a document from a publication, accessible via a "secret" parameter in the URL. No additional authentication necessary.
responses:
"200":
description: Generates a document based on a publication and provides a "secret" parameter in the URL for accessing it. The "secret" parameter in the URL is used for authorization, ensuring only users with the "secret" can access the document.
content:
application/json:
schema:
type: string
example: "https://app.lawlift.de/publications/document/YSHqK23Y7RGAtFHB6/yfoDmbuHp5TiQgEfb?secret=tf3BIEa5NVgM6UQhwGoDxwvdGiVmVS11pPxcXlHrSyv%252BwprPbfw32JKm6lTn96RUBO5JS6Z70vM%253D"
"405":
description: Unexpected request method
"401":
description: Authentication failed
"500":
description: "Internal server error"
content:
application/json:
schema:
type: string
example: "No publication found for the given shortId"
requestBody:
$ref: "#/components/requestBodies/SecretURLPublicationDocument"
/publication/{publicationId}:
get:
tags:
- publications
description: Get Publication by ID
operationId: getPublicationById
parameters:
- name: publicationId
in: path
description: ID of the publication that needs to be fetched
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Publication"
security:
- Bearer: []
/publications:
get:
tags:
- publications
description: Get Publications
responses:
"200":
description: OK
/documents/generate:
post:
tags:
- documents
summary: Generate document link
operationId: generateDocument
responses:
"200":
description: Returns a link to a generated document
content:
application/json:
schema:
type: string
example: "https://app.lawlift.de/Contract/YSHqK23Y7RGAtFHB6/yfoDmbuHp5TiQgEfb"
"405":
description: Invalid input
security:
- Bearer: []
requestBody:
$ref: "#/components/requestBodies/Document"
/templates:
get:
tags:
- templates
summary: Get list of active templates
description: Returns a map of status codes to quantities
operationId: getTemplates
responses:
"200":
description: successful operation
content:
application/json:
schema:
type: object
additionalProperties:
type: integer
format: int32
security:
- Bearer: []
"/template/{templateId}":
get:
tags:
- templates
summary: Get data for a specific template
description: >-
Retrieve available fields for a template.
operationId: getTemplateById
parameters:
- name: templateId
in: path
description: ID of template that needs to be fetched
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Template"
"400":
description: Invalid ID supplied
"404":
description: Template not found
security:
- Bearer: []
components:
schemas:
Template:
type: object
properties:
_id:
type: string
name:
type: string
tags:
type: array
items:
type: string
description:
type: string
version:
type: integer
draftVersion:
type: integer
createdAt:
type: string
timesUsed:
type: integer
languages:
type: object
properties:
original:
type: string
translated:
type: string
documentsGenerated:
type: integer
fields:
type: array
items:
type: string
description: Mapped field name
Publication:
type: object
properties:
id:
type: string
shortId:
type: string
templateId:
type: string
name:
type: string
status:
type: object
properties:
publishedAt:
type: string
published:
type: boolean
version:
type: integer
createdAt:
type: string
updatedAt:
type: string
tags:
type: array
items:
type: string
fields:
type: array
items:
type: string
requestBodies:
Data:
content:
application/json:
schema:
type: string
Document:
content:
application/json:
schema:
type: object
required:
- templateId
- data
properties:
templateId:
type: string
description: The Id of the template from which a document should be generated.
data:
type: object
description: "The data object with the mapped fields, can be serialized JSON or encrypted with tweet-nacl (Base64)."
example:
{
"fieldName1": true,
fieldName2: false,
fieldName3: "First name",
serialField1: ["namePerson1", "namePerson2", "namePerson2"],
serialField2: ["namePerson1", "namePerson2", "namePerson2"],
}
authorEmail:
type: string
description: Email of the author of the document.
clientName:
type: string
description: The name of the client.
caseName:
type: string
description: The name of the case.
autoExport:
type: boolean
description: Automatically exports fully rendered documents.
example: false
meta:
type: object
description: "Custom meta data fields that will be exported into docx (settings.xml). Useful to insert data from your system and extract it from exported docx files."
example: { "metaField1": "value1", "metaField2": "value2" }
nonce:
type: string
description: Only required if data payload is encrypted.
example: null
PublicationDocument:
content:
application/json:
schema:
type: object
required:
- templateId
- data
properties:
shortId:
type: string
description: The shortId of the publication from which a document should be generated.
data:
type: object
description: "The data object with the mapped fields, can be serialized JSON or encrypted with tweet-nacl (Base64)."
example:
{
"fieldName1": true,
fieldName2: false,
fieldName3: "First name",
serialField1: ["namePerson1", "namePerson2", "namePerson2"],
serialField2: ["namePerson1", "namePerson2", "namePerson2"],
}
authorEmail:
type: string
description: Email of the author of the document.
clientName:
type: string
description: The name of the client.
caseName:
type: string
description: The name of the case.
autoExport:
type: boolean
description: Automatically exports fully rendered documents.
example: false
meta:
type: object
description: "Custom meta data fields that will be exported into docx (settings.xml). Useful to insert data from your system and extract it from exported docx files."
example: { "metaField1": "value1", "metaField2": "value2" }
nonce:
type: string
description: Only required if data payload is encrypted.
example: null
required: true
SecretURLPublicationDocument:
content:
application/json:
schema:
type: object
required:
- shortId
- data
properties:
shortId:
type: string
description: The shortId of the publication from which a document should be generated.
data:
type: object
description: The data object with the mapped fields as keys, and the answer values for the values. Must be serialized JSON.
example:
{
"fieldName1": true,
fieldName2: false,
fieldName3: "First name",
serialField1: ["namePerson1", "namePerson2", "namePerson2"],
serialField2: ["namePerson1", "namePerson2", "namePerson2"],
}
authorEmail:
type: string
description: Email of the author of the document.
autoExport:
type: boolean
description: Flag to automatically export the document upon rendering.
example: false
required: true
securitySchemes:
Bearer:
type: http
scheme: bearer