|
@@ -0,0 +1,341 @@
|
|
1
|
+
|
|
2
|
+definitions:
|
|
3
|
+ CommentSchema:
|
|
4
|
+ properties:
|
|
5
|
+ content_id:
|
|
6
|
+ example: 6
|
|
7
|
+ format: int32
|
|
8
|
+ type: integer
|
|
9
|
+ parent_id:
|
|
10
|
+ example: 34
|
|
11
|
+ format: int32
|
|
12
|
+ type: integer
|
|
13
|
+ x-nullable: true
|
|
14
|
+ content:
|
|
15
|
+ type: string
|
|
16
|
+ example: "Coucou !"
|
|
17
|
+ author:
|
|
18
|
+ $ref: '#/definitions/UserDigestSchema'
|
|
19
|
+ UserDigestSchema:
|
|
20
|
+ properties:
|
|
21
|
+ user_id:
|
|
22
|
+ example: 3
|
|
23
|
+ format: int32
|
|
24
|
+ readOnly: true
|
|
25
|
+ type: integer
|
|
26
|
+ avatar_url:
|
|
27
|
+ description: avatar_url is the url to the image file. If no avatar, then set
|
|
28
|
+ it to null (and frontend will interpret this with a default avatar)
|
|
29
|
+ example: /api/v2/assets/avatars/suri-cate.jpg
|
|
30
|
+ format: url
|
|
31
|
+ type: string
|
|
32
|
+ x-nullable: true
|
|
33
|
+ public_name:
|
|
34
|
+ example: Suri Cate
|
|
35
|
+ type: string
|
|
36
|
+ HtmlPageContentSchema:
|
|
37
|
+ properties:
|
|
38
|
+ content_type:
|
|
39
|
+ enum:
|
|
40
|
+ - thread
|
|
41
|
+ - file
|
|
42
|
+ - markdownpage
|
|
43
|
+ - page
|
|
44
|
+ - folder
|
|
45
|
+ example: htmlpage
|
|
46
|
+ type: string
|
|
47
|
+ content_id:
|
|
48
|
+ example: 6
|
|
49
|
+ format: int32
|
|
50
|
+ type: integer
|
|
51
|
+ is_archived:
|
|
52
|
+ example: false
|
|
53
|
+ type: boolean
|
|
54
|
+ is_deleted:
|
|
55
|
+ example: false
|
|
56
|
+ type: boolean
|
|
57
|
+ label:
|
|
58
|
+ example: Intervention Report 12
|
|
59
|
+ type: string
|
|
60
|
+ parent_id:
|
|
61
|
+ example: 34
|
|
62
|
+ format: int32
|
|
63
|
+ type: integer
|
|
64
|
+ x-nullable: true
|
|
65
|
+ show_in_ui:
|
|
66
|
+ description: if false, then do not show content in the treeview. This may
|
|
67
|
+ his maybe used for specific contents or for sub-contents. Default is True.
|
|
68
|
+ In first version of the API, this field is always True
|
|
69
|
+ example: true
|
|
70
|
+ type: boolean
|
|
71
|
+ slug:
|
|
72
|
+ example: intervention-report-12
|
|
73
|
+ type: string
|
|
74
|
+ status_slug:
|
|
75
|
+ description: this slug is found in content_type available statuses
|
|
76
|
+ enum:
|
|
77
|
+ - open
|
|
78
|
+ - closed-validated
|
|
79
|
+ - closed-unvalidated
|
|
80
|
+ - closed-deprecated
|
|
81
|
+ example: closed-deprecated
|
|
82
|
+ type: string
|
|
83
|
+ sub_content_types:
|
|
84
|
+ description: list of content types allowed as sub contents. This field is
|
|
85
|
+ required for folder contents, set it to empty list in other cases
|
|
86
|
+ items:
|
|
87
|
+ type: string
|
|
88
|
+ type: array
|
|
89
|
+ workspace_id:
|
|
90
|
+ example: 19
|
|
91
|
+ format: int32
|
|
92
|
+ type: integer
|
|
93
|
+ current_revision_id:
|
|
94
|
+ type: integer
|
|
95
|
+ example: 74
|
|
96
|
+ created:
|
|
97
|
+ format: date-time
|
|
98
|
+ type: string
|
|
99
|
+ author:
|
|
100
|
+ $ref: '#/definitions/UserDigestSchema'
|
|
101
|
+ modified:
|
|
102
|
+ format: date-time
|
|
103
|
+ type: string
|
|
104
|
+ last_modifier:
|
|
105
|
+ $ref: '#/definitions/UserDigestSchema'
|
|
106
|
+ content:
|
|
107
|
+ example: '<p> Coucou </p>'
|
|
108
|
+ type: string
|
|
109
|
+ type: object
|
|
110
|
+ HtmlPageRevisionSchema:
|
|
111
|
+ properties:
|
|
112
|
+ content_type:
|
|
113
|
+ enum:
|
|
114
|
+ - thread
|
|
115
|
+ - file
|
|
116
|
+ - markdownpage
|
|
117
|
+ - page
|
|
118
|
+ - folder
|
|
119
|
+ example: htmlpage
|
|
120
|
+ type: string
|
|
121
|
+ content_id:
|
|
122
|
+ example: 6
|
|
123
|
+ format: int32
|
|
124
|
+ type: integer
|
|
125
|
+ is_archived:
|
|
126
|
+ example: false
|
|
127
|
+ type: boolean
|
|
128
|
+ is_deleted:
|
|
129
|
+ example: false
|
|
130
|
+ type: boolean
|
|
131
|
+ label:
|
|
132
|
+ example: Intervention Report 12
|
|
133
|
+ type: string
|
|
134
|
+ parent_id:
|
|
135
|
+ example: 34
|
|
136
|
+ format: int32
|
|
137
|
+ type: integer
|
|
138
|
+ x-nullable: true
|
|
139
|
+ show_in_ui:
|
|
140
|
+ description: if false, then do not show content in the treeview. This may
|
|
141
|
+ his maybe used for specific contents or for sub-contents. Default is True.
|
|
142
|
+ In first version of the API, this field is always True
|
|
143
|
+ example: true
|
|
144
|
+ type: boolean
|
|
145
|
+ slug:
|
|
146
|
+ example: intervention-report-12
|
|
147
|
+ type: string
|
|
148
|
+ status_slug:
|
|
149
|
+ description: this slug is found in content_type available statuses
|
|
150
|
+ enum:
|
|
151
|
+ - open
|
|
152
|
+ - closed-validated
|
|
153
|
+ - closed-unvalidated
|
|
154
|
+ - closed-deprecated
|
|
155
|
+ example: closed-deprecated
|
|
156
|
+ type: string
|
|
157
|
+ sub_content_types:
|
|
158
|
+ description: list of content types allowed as sub contents. This field is
|
|
159
|
+ required for folder contents, set it to empty list in other cases
|
|
160
|
+ items:
|
|
161
|
+ type: string
|
|
162
|
+ type: array
|
|
163
|
+ workspace_id:
|
|
164
|
+ example: 19
|
|
165
|
+ format: int32
|
|
166
|
+ type: integer
|
|
167
|
+ revision_id:
|
|
168
|
+ type: integer
|
|
169
|
+ example: 74
|
|
170
|
+ created:
|
|
171
|
+ format: date-time
|
|
172
|
+ type: string
|
|
173
|
+ author:
|
|
174
|
+ $ref: '#/definitions/UserDigestSchema'
|
|
175
|
+ content:
|
|
176
|
+ example: '<p> Coucou </p>'
|
|
177
|
+ type: string
|
|
178
|
+ type: object
|
|
179
|
+ HtmlPageRevisionListSchema:
|
|
180
|
+ properties:
|
|
181
|
+ revisions:
|
|
182
|
+ type: array
|
|
183
|
+ items:
|
|
184
|
+ $ref: '#/definitions/HtmlPageRevisionSchema'
|
|
185
|
+ revision_nb:
|
|
186
|
+ type: integer
|
|
187
|
+ example: 40
|
|
188
|
+ HtmlPageModifySchema:
|
|
189
|
+ type: object
|
|
190
|
+ properties:
|
|
191
|
+ label:
|
|
192
|
+ example: "My Page"
|
|
193
|
+ type: string
|
|
194
|
+ content:
|
|
195
|
+ example: '<p> Coucou </p>'
|
|
196
|
+ type: string
|
|
197
|
+ ContentSetStatusSchema:
|
|
198
|
+ type: object
|
|
199
|
+ properties:
|
|
200
|
+ status:
|
|
201
|
+ example: "open-workinprogress"
|
|
202
|
+ type: string
|
|
203
|
+ NoContentSchema:
|
|
204
|
+ type: object
|
|
205
|
+info:
|
|
206
|
+ description: API of Tracim v2
|
|
207
|
+ title: Tracim v2 API
|
|
208
|
+ version: 1.0.0
|
|
209
|
+parameters: {}
|
|
210
|
+paths:
|
|
211
|
+ "/api/v2/workspaces/{workspace_id}/htmlpages/{htmlpage_id}":
|
|
212
|
+ get:
|
|
213
|
+ description: "get htmlpage content"
|
|
214
|
+ parameters:
|
|
215
|
+ - name: "workspace_id"
|
|
216
|
+ in: path
|
|
217
|
+ required: true
|
|
218
|
+ type: integer
|
|
219
|
+ description: id of the current workspace.
|
|
220
|
+ - name: "htmlpage_id"
|
|
221
|
+ in: path
|
|
222
|
+ required: true
|
|
223
|
+ type: integer
|
|
224
|
+ description: content id of htmlpage.
|
|
225
|
+ responses:
|
|
226
|
+ '200':
|
|
227
|
+ description: "nominal case"
|
|
228
|
+ schema:
|
|
229
|
+ $ref: '#/definitions/HtmlPageContentSchema'
|
|
230
|
+ put:
|
|
231
|
+ description: "modify htmlpage label or/and content"
|
|
232
|
+ parameters:
|
|
233
|
+ - in: body
|
|
234
|
+ name: "body"
|
|
235
|
+ schema:
|
|
236
|
+ $ref: '#/definitions/HtmlPageModifySchema'
|
|
237
|
+ - name: "workspace_id"
|
|
238
|
+ in: path
|
|
239
|
+ required: true
|
|
240
|
+ type: integer
|
|
241
|
+ description: id of the current workspace.
|
|
242
|
+ - name: "htmlpage_id"
|
|
243
|
+ in: path
|
|
244
|
+ required: true
|
|
245
|
+ type: integer
|
|
246
|
+ description: content id of htmlpage.
|
|
247
|
+ responses:
|
|
248
|
+ '200':
|
|
249
|
+ description: "nominal case"
|
|
250
|
+ schema:
|
|
251
|
+ $ref: '#/definitions/HtmlPageContentSchema'
|
|
252
|
+ "/api/v2/workspaces/{workspace_id}/htmlpages/{htmlpage_id}/revisions":
|
|
253
|
+ get:
|
|
254
|
+ description: "gets all htmlpages revisions (sorted by"
|
|
255
|
+ parameters:
|
|
256
|
+ - name: "workspace_id"
|
|
257
|
+ in: path
|
|
258
|
+ required: true
|
|
259
|
+ type: integer
|
|
260
|
+ description: id of the current workspace.
|
|
261
|
+ - name: "htmlpage_id"
|
|
262
|
+ in: path
|
|
263
|
+ required: true
|
|
264
|
+ type: integer
|
|
265
|
+ description: content id of htmlpage.
|
|
266
|
+ responses:
|
|
267
|
+ '200':
|
|
268
|
+ description: "nominal case"
|
|
269
|
+ schema:
|
|
270
|
+ $ref: '#/definitions/HtmlPageRevisionListSchema'
|
|
271
|
+ "/api/v2/workspaces/{workspace_id}/htmlpages/{htmlpage_id}/status":
|
|
272
|
+ put:
|
|
273
|
+ description: "set htmlpage content status"
|
|
274
|
+ parameters:
|
|
275
|
+ - in: body
|
|
276
|
+ name: "body"
|
|
277
|
+ schema:
|
|
278
|
+ $ref: '#/definitions/ContentSetStatusSchema'
|
|
279
|
+ - name: "workspace_id"
|
|
280
|
+ in: path
|
|
281
|
+ required: true
|
|
282
|
+ type: integer
|
|
283
|
+ description: id of the current workspace.
|
|
284
|
+ - name: "htmlpage_id"
|
|
285
|
+ in: path
|
|
286
|
+ required: true
|
|
287
|
+ type: integer
|
|
288
|
+ description: content id of htmlpage.
|
|
289
|
+ responses:
|
|
290
|
+ '200':
|
|
291
|
+ description: "nominal case"
|
|
292
|
+ schema:
|
|
293
|
+ $ref: '#/definitions/NoContentSchema'
|
|
294
|
+ "/api/v2/workspaces/{workspace_id}/contents/{content_id}/comments":
|
|
295
|
+ get:
|
|
296
|
+ description: "get all comments related to a content"
|
|
297
|
+ parameters:
|
|
298
|
+ - name: "workspace_id"
|
|
299
|
+ in: path
|
|
300
|
+ required: true
|
|
301
|
+ type: integer
|
|
302
|
+ description: id of the current workspace.
|
|
303
|
+ - name: "content_id"
|
|
304
|
+ in: path
|
|
305
|
+ required: true
|
|
306
|
+ type: integer
|
|
307
|
+ description: content id.
|
|
308
|
+ responses:
|
|
309
|
+ '200':
|
|
310
|
+ description: "nominal case"
|
|
311
|
+ schema:
|
|
312
|
+ type: array
|
|
313
|
+ items:
|
|
314
|
+ $ref: '#/definitions/CommentSchema'
|
|
315
|
+
|
|
316
|
+ "/api/v2/workspaces/{workspace_id}/contents/{content_id}/comments/{comments_id}":
|
|
317
|
+ delete:
|
|
318
|
+ description: "delete one comment"
|
|
319
|
+ parameters:
|
|
320
|
+ - name: "workspace_id"
|
|
321
|
+ in: path
|
|
322
|
+ required: true
|
|
323
|
+ type: integer
|
|
324
|
+ description: id of the current workspace.
|
|
325
|
+ - name: "content_id"
|
|
326
|
+ in: path
|
|
327
|
+ required: true
|
|
328
|
+ type: integer
|
|
329
|
+ description: content id.
|
|
330
|
+ - name: "comments_id"
|
|
331
|
+ in: path
|
|
332
|
+ required: true
|
|
333
|
+ type: integer
|
|
334
|
+ description: id of a comment related to content content_id.
|
|
335
|
+ responses:
|
|
336
|
+ '204':
|
|
337
|
+ description: "nominal case"
|
|
338
|
+ schema:
|
|
339
|
+ $ref: '#/definitions/NoContentSchema'
|
|
340
|
+swagger: '2.0'
|
|
341
|
+tags: []
|