ttest 9.0KB

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