1
0

openapi.json 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "files",
  5. "version": "0.0.1",
  6. "description": "File Management",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {
  23. "Capabilities": {
  24. "type": "object",
  25. "required": [
  26. "files"
  27. ],
  28. "properties": {
  29. "files": {
  30. "type": "object",
  31. "required": [
  32. "bigfilechunking",
  33. "blacklisted_files",
  34. "forbidden_filename_characters",
  35. "directEditing"
  36. ],
  37. "properties": {
  38. "bigfilechunking": {
  39. "type": "boolean"
  40. },
  41. "blacklisted_files": {
  42. "type": "array",
  43. "items": {
  44. "type": "object"
  45. }
  46. },
  47. "forbidden_filename_characters": {
  48. "type": "array",
  49. "items": {
  50. "type": "string"
  51. }
  52. },
  53. "directEditing": {
  54. "type": "object",
  55. "required": [
  56. "url",
  57. "etag",
  58. "supportsFileId"
  59. ],
  60. "properties": {
  61. "url": {
  62. "type": "string"
  63. },
  64. "etag": {
  65. "type": "string"
  66. },
  67. "supportsFileId": {
  68. "type": "boolean"
  69. }
  70. }
  71. }
  72. }
  73. }
  74. }
  75. },
  76. "OCSMeta": {
  77. "type": "object",
  78. "required": [
  79. "status",
  80. "statuscode"
  81. ],
  82. "properties": {
  83. "status": {
  84. "type": "string"
  85. },
  86. "statuscode": {
  87. "type": "integer"
  88. },
  89. "message": {
  90. "type": "string"
  91. },
  92. "totalitems": {
  93. "type": "string"
  94. },
  95. "itemsperpage": {
  96. "type": "string"
  97. }
  98. }
  99. },
  100. "TemplateFile": {
  101. "type": "object",
  102. "required": [
  103. "basename",
  104. "etag",
  105. "fileid",
  106. "filename",
  107. "lastmod",
  108. "mime",
  109. "size",
  110. "type",
  111. "hasPreview"
  112. ],
  113. "properties": {
  114. "basename": {
  115. "type": "string"
  116. },
  117. "etag": {
  118. "type": "string"
  119. },
  120. "fileid": {
  121. "type": "integer",
  122. "format": "int64"
  123. },
  124. "filename": {
  125. "type": "string",
  126. "nullable": true
  127. },
  128. "lastmod": {
  129. "type": "integer",
  130. "format": "int64"
  131. },
  132. "mime": {
  133. "type": "string"
  134. },
  135. "size": {
  136. "type": "integer",
  137. "format": "int64"
  138. },
  139. "type": {
  140. "type": "string"
  141. },
  142. "hasPreview": {
  143. "type": "boolean"
  144. }
  145. }
  146. },
  147. "TemplateFileCreator": {
  148. "type": "object",
  149. "required": [
  150. "app",
  151. "label",
  152. "extension",
  153. "iconClass",
  154. "iconSvgInline",
  155. "mimetypes",
  156. "ratio",
  157. "actionLabel"
  158. ],
  159. "properties": {
  160. "app": {
  161. "type": "string"
  162. },
  163. "label": {
  164. "type": "string"
  165. },
  166. "extension": {
  167. "type": "string"
  168. },
  169. "iconClass": {
  170. "type": "string",
  171. "nullable": true
  172. },
  173. "iconSvgInline": {
  174. "type": "string",
  175. "nullable": true
  176. },
  177. "mimetypes": {
  178. "type": "array",
  179. "items": {
  180. "type": "string"
  181. }
  182. },
  183. "ratio": {
  184. "type": "number",
  185. "format": "double",
  186. "nullable": true
  187. },
  188. "actionLabel": {
  189. "type": "string"
  190. }
  191. }
  192. }
  193. }
  194. },
  195. "paths": {
  196. "/index.php/apps/files/api/v1/thumbnail/{x}/{y}/{file}": {
  197. "get": {
  198. "operationId": "api-get-thumbnail",
  199. "summary": "Gets a thumbnail of the specified file",
  200. "tags": [
  201. "api"
  202. ],
  203. "security": [
  204. {
  205. "bearer_auth": []
  206. },
  207. {
  208. "basic_auth": []
  209. }
  210. ],
  211. "parameters": [
  212. {
  213. "name": "x",
  214. "in": "path",
  215. "description": "Width of the thumbnail",
  216. "required": true,
  217. "schema": {
  218. "type": "integer",
  219. "format": "int64"
  220. }
  221. },
  222. {
  223. "name": "y",
  224. "in": "path",
  225. "description": "Height of the thumbnail",
  226. "required": true,
  227. "schema": {
  228. "type": "integer",
  229. "format": "int64"
  230. }
  231. },
  232. {
  233. "name": "file",
  234. "in": "path",
  235. "description": "URL-encoded filename",
  236. "required": true,
  237. "schema": {
  238. "type": "string",
  239. "pattern": "^.+$"
  240. }
  241. }
  242. ],
  243. "responses": {
  244. "200": {
  245. "description": "Thumbnail returned",
  246. "content": {
  247. "*/*": {
  248. "schema": {
  249. "type": "string",
  250. "format": "binary"
  251. }
  252. }
  253. }
  254. },
  255. "400": {
  256. "description": "Getting thumbnail is not possible",
  257. "content": {
  258. "application/json": {
  259. "schema": {
  260. "type": "object",
  261. "properties": {
  262. "message": {
  263. "type": "string"
  264. }
  265. }
  266. }
  267. }
  268. }
  269. },
  270. "404": {
  271. "description": "File not found",
  272. "content": {
  273. "application/json": {
  274. "schema": {
  275. "type": "object",
  276. "properties": {
  277. "message": {
  278. "type": "string"
  279. }
  280. }
  281. }
  282. }
  283. }
  284. }
  285. }
  286. }
  287. },
  288. "/ocs/v2.php/apps/files/api/v1/directEditing": {
  289. "get": {
  290. "operationId": "direct_editing-info",
  291. "summary": "Get the direct editing capabilities",
  292. "tags": [
  293. "direct_editing"
  294. ],
  295. "security": [
  296. {
  297. "bearer_auth": []
  298. },
  299. {
  300. "basic_auth": []
  301. }
  302. ],
  303. "parameters": [
  304. {
  305. "name": "OCS-APIRequest",
  306. "in": "header",
  307. "description": "Required to be true for the API request to pass",
  308. "required": true,
  309. "schema": {
  310. "type": "boolean",
  311. "default": true
  312. }
  313. }
  314. ],
  315. "responses": {
  316. "200": {
  317. "description": "Direct editing capabilities returned",
  318. "content": {
  319. "application/json": {
  320. "schema": {
  321. "type": "object",
  322. "required": [
  323. "ocs"
  324. ],
  325. "properties": {
  326. "ocs": {
  327. "type": "object",
  328. "required": [
  329. "meta",
  330. "data"
  331. ],
  332. "properties": {
  333. "meta": {
  334. "$ref": "#/components/schemas/OCSMeta"
  335. },
  336. "data": {
  337. "type": "object",
  338. "required": [
  339. "editors",
  340. "creators"
  341. ],
  342. "properties": {
  343. "editors": {
  344. "type": "object",
  345. "additionalProperties": {
  346. "type": "object",
  347. "required": [
  348. "id",
  349. "name",
  350. "mimetypes",
  351. "optionalMimetypes",
  352. "secure"
  353. ],
  354. "properties": {
  355. "id": {
  356. "type": "string"
  357. },
  358. "name": {
  359. "type": "string"
  360. },
  361. "mimetypes": {
  362. "type": "array",
  363. "items": {
  364. "type": "string"
  365. }
  366. },
  367. "optionalMimetypes": {
  368. "type": "array",
  369. "items": {
  370. "type": "string"
  371. }
  372. },
  373. "secure": {
  374. "type": "boolean"
  375. }
  376. }
  377. }
  378. },
  379. "creators": {
  380. "type": "object",
  381. "additionalProperties": {
  382. "type": "object",
  383. "required": [
  384. "id",
  385. "editor",
  386. "name",
  387. "extension",
  388. "templates",
  389. "mimetypes"
  390. ],
  391. "properties": {
  392. "id": {
  393. "type": "string"
  394. },
  395. "editor": {
  396. "type": "string"
  397. },
  398. "name": {
  399. "type": "string"
  400. },
  401. "extension": {
  402. "type": "string"
  403. },
  404. "templates": {
  405. "type": "boolean"
  406. },
  407. "mimetypes": {
  408. "type": "array",
  409. "items": {
  410. "type": "string"
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. }
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. }
  425. }
  426. }
  427. },
  428. "/ocs/v2.php/apps/files/api/v1/directEditing/templates/{editorId}/{creatorId}": {
  429. "get": {
  430. "operationId": "direct_editing-templates",
  431. "summary": "Get the templates for direct editing",
  432. "tags": [
  433. "direct_editing"
  434. ],
  435. "security": [
  436. {
  437. "bearer_auth": []
  438. },
  439. {
  440. "basic_auth": []
  441. }
  442. ],
  443. "parameters": [
  444. {
  445. "name": "editorId",
  446. "in": "path",
  447. "description": "ID of the editor",
  448. "required": true,
  449. "schema": {
  450. "type": "string"
  451. }
  452. },
  453. {
  454. "name": "creatorId",
  455. "in": "path",
  456. "description": "ID of the creator",
  457. "required": true,
  458. "schema": {
  459. "type": "string"
  460. }
  461. },
  462. {
  463. "name": "OCS-APIRequest",
  464. "in": "header",
  465. "description": "Required to be true for the API request to pass",
  466. "required": true,
  467. "schema": {
  468. "type": "boolean",
  469. "default": true
  470. }
  471. }
  472. ],
  473. "responses": {
  474. "200": {
  475. "description": "Templates returned",
  476. "content": {
  477. "application/json": {
  478. "schema": {
  479. "type": "object",
  480. "required": [
  481. "ocs"
  482. ],
  483. "properties": {
  484. "ocs": {
  485. "type": "object",
  486. "required": [
  487. "meta",
  488. "data"
  489. ],
  490. "properties": {
  491. "meta": {
  492. "$ref": "#/components/schemas/OCSMeta"
  493. },
  494. "data": {
  495. "type": "object",
  496. "required": [
  497. "templates"
  498. ],
  499. "properties": {
  500. "templates": {
  501. "type": "object",
  502. "additionalProperties": {
  503. "type": "object",
  504. "required": [
  505. "id",
  506. "title",
  507. "preview",
  508. "extension",
  509. "mimetype"
  510. ],
  511. "properties": {
  512. "id": {
  513. "type": "string"
  514. },
  515. "title": {
  516. "type": "string"
  517. },
  518. "preview": {
  519. "type": "string",
  520. "nullable": true
  521. },
  522. "extension": {
  523. "type": "string"
  524. },
  525. "mimetype": {
  526. "type": "string"
  527. }
  528. }
  529. }
  530. }
  531. }
  532. }
  533. }
  534. }
  535. }
  536. }
  537. }
  538. }
  539. },
  540. "500": {
  541. "description": "",
  542. "content": {
  543. "application/json": {
  544. "schema": {
  545. "type": "object",
  546. "required": [
  547. "ocs"
  548. ],
  549. "properties": {
  550. "ocs": {
  551. "type": "object",
  552. "required": [
  553. "meta",
  554. "data"
  555. ],
  556. "properties": {
  557. "meta": {
  558. "$ref": "#/components/schemas/OCSMeta"
  559. },
  560. "data": {
  561. "type": "object",
  562. "required": [
  563. "message"
  564. ],
  565. "properties": {
  566. "message": {
  567. "type": "string"
  568. }
  569. }
  570. }
  571. }
  572. }
  573. }
  574. }
  575. }
  576. }
  577. }
  578. }
  579. }
  580. },
  581. "/ocs/v2.php/apps/files/api/v1/directEditing/open": {
  582. "post": {
  583. "operationId": "direct_editing-open",
  584. "summary": "Open a file for direct editing",
  585. "tags": [
  586. "direct_editing"
  587. ],
  588. "security": [
  589. {
  590. "bearer_auth": []
  591. },
  592. {
  593. "basic_auth": []
  594. }
  595. ],
  596. "requestBody": {
  597. "required": true,
  598. "content": {
  599. "application/json": {
  600. "schema": {
  601. "type": "object",
  602. "required": [
  603. "path"
  604. ],
  605. "properties": {
  606. "path": {
  607. "type": "string",
  608. "description": "Path of the file"
  609. },
  610. "editorId": {
  611. "type": "string",
  612. "nullable": true,
  613. "description": "ID of the editor"
  614. },
  615. "fileId": {
  616. "type": "integer",
  617. "format": "int64",
  618. "nullable": true,
  619. "description": "ID of the file"
  620. }
  621. }
  622. }
  623. }
  624. }
  625. },
  626. "parameters": [
  627. {
  628. "name": "OCS-APIRequest",
  629. "in": "header",
  630. "description": "Required to be true for the API request to pass",
  631. "required": true,
  632. "schema": {
  633. "type": "boolean",
  634. "default": true
  635. }
  636. }
  637. ],
  638. "responses": {
  639. "200": {
  640. "description": "URL for direct editing returned",
  641. "content": {
  642. "application/json": {
  643. "schema": {
  644. "type": "object",
  645. "required": [
  646. "ocs"
  647. ],
  648. "properties": {
  649. "ocs": {
  650. "type": "object",
  651. "required": [
  652. "meta",
  653. "data"
  654. ],
  655. "properties": {
  656. "meta": {
  657. "$ref": "#/components/schemas/OCSMeta"
  658. },
  659. "data": {
  660. "type": "object",
  661. "required": [
  662. "url"
  663. ],
  664. "properties": {
  665. "url": {
  666. "type": "string"
  667. }
  668. }
  669. }
  670. }
  671. }
  672. }
  673. }
  674. }
  675. }
  676. },
  677. "403": {
  678. "description": "Opening file is not allowed",
  679. "content": {
  680. "application/json": {
  681. "schema": {
  682. "type": "object",
  683. "required": [
  684. "ocs"
  685. ],
  686. "properties": {
  687. "ocs": {
  688. "type": "object",
  689. "required": [
  690. "meta",
  691. "data"
  692. ],
  693. "properties": {
  694. "meta": {
  695. "$ref": "#/components/schemas/OCSMeta"
  696. },
  697. "data": {
  698. "type": "object",
  699. "required": [
  700. "message"
  701. ],
  702. "properties": {
  703. "message": {
  704. "type": "string"
  705. }
  706. }
  707. }
  708. }
  709. }
  710. }
  711. }
  712. }
  713. }
  714. },
  715. "500": {
  716. "description": "",
  717. "content": {
  718. "application/json": {
  719. "schema": {
  720. "type": "object",
  721. "required": [
  722. "ocs"
  723. ],
  724. "properties": {
  725. "ocs": {
  726. "type": "object",
  727. "required": [
  728. "meta",
  729. "data"
  730. ],
  731. "properties": {
  732. "meta": {
  733. "$ref": "#/components/schemas/OCSMeta"
  734. },
  735. "data": {
  736. "type": "object",
  737. "required": [
  738. "message"
  739. ],
  740. "properties": {
  741. "message": {
  742. "type": "string"
  743. }
  744. }
  745. }
  746. }
  747. }
  748. }
  749. }
  750. }
  751. }
  752. }
  753. }
  754. }
  755. },
  756. "/ocs/v2.php/apps/files/api/v1/directEditing/create": {
  757. "post": {
  758. "operationId": "direct_editing-create",
  759. "summary": "Create a file for direct editing",
  760. "tags": [
  761. "direct_editing"
  762. ],
  763. "security": [
  764. {
  765. "bearer_auth": []
  766. },
  767. {
  768. "basic_auth": []
  769. }
  770. ],
  771. "requestBody": {
  772. "required": true,
  773. "content": {
  774. "application/json": {
  775. "schema": {
  776. "type": "object",
  777. "required": [
  778. "path",
  779. "editorId",
  780. "creatorId"
  781. ],
  782. "properties": {
  783. "path": {
  784. "type": "string",
  785. "description": "Path of the file"
  786. },
  787. "editorId": {
  788. "type": "string",
  789. "description": "ID of the editor"
  790. },
  791. "creatorId": {
  792. "type": "string",
  793. "description": "ID of the creator"
  794. },
  795. "templateId": {
  796. "type": "string",
  797. "nullable": true,
  798. "description": "ID of the template"
  799. }
  800. }
  801. }
  802. }
  803. }
  804. },
  805. "parameters": [
  806. {
  807. "name": "OCS-APIRequest",
  808. "in": "header",
  809. "description": "Required to be true for the API request to pass",
  810. "required": true,
  811. "schema": {
  812. "type": "boolean",
  813. "default": true
  814. }
  815. }
  816. ],
  817. "responses": {
  818. "200": {
  819. "description": "URL for direct editing returned",
  820. "content": {
  821. "application/json": {
  822. "schema": {
  823. "type": "object",
  824. "required": [
  825. "ocs"
  826. ],
  827. "properties": {
  828. "ocs": {
  829. "type": "object",
  830. "required": [
  831. "meta",
  832. "data"
  833. ],
  834. "properties": {
  835. "meta": {
  836. "$ref": "#/components/schemas/OCSMeta"
  837. },
  838. "data": {
  839. "type": "object",
  840. "required": [
  841. "url"
  842. ],
  843. "properties": {
  844. "url": {
  845. "type": "string"
  846. }
  847. }
  848. }
  849. }
  850. }
  851. }
  852. }
  853. }
  854. }
  855. },
  856. "403": {
  857. "description": "Opening file is not allowed",
  858. "content": {
  859. "application/json": {
  860. "schema": {
  861. "type": "object",
  862. "required": [
  863. "ocs"
  864. ],
  865. "properties": {
  866. "ocs": {
  867. "type": "object",
  868. "required": [
  869. "meta",
  870. "data"
  871. ],
  872. "properties": {
  873. "meta": {
  874. "$ref": "#/components/schemas/OCSMeta"
  875. },
  876. "data": {
  877. "type": "object",
  878. "required": [
  879. "message"
  880. ],
  881. "properties": {
  882. "message": {
  883. "type": "string"
  884. }
  885. }
  886. }
  887. }
  888. }
  889. }
  890. }
  891. }
  892. }
  893. },
  894. "500": {
  895. "description": "",
  896. "content": {
  897. "application/json": {
  898. "schema": {
  899. "type": "object",
  900. "required": [
  901. "ocs"
  902. ],
  903. "properties": {
  904. "ocs": {
  905. "type": "object",
  906. "required": [
  907. "meta",
  908. "data"
  909. ],
  910. "properties": {
  911. "meta": {
  912. "$ref": "#/components/schemas/OCSMeta"
  913. },
  914. "data": {
  915. "type": "object",
  916. "required": [
  917. "message"
  918. ],
  919. "properties": {
  920. "message": {
  921. "type": "string"
  922. }
  923. }
  924. }
  925. }
  926. }
  927. }
  928. }
  929. }
  930. }
  931. }
  932. }
  933. }
  934. },
  935. "/ocs/v2.php/apps/files/api/v1/templates": {
  936. "get": {
  937. "operationId": "template-list",
  938. "summary": "List the available templates",
  939. "tags": [
  940. "template"
  941. ],
  942. "security": [
  943. {
  944. "bearer_auth": []
  945. },
  946. {
  947. "basic_auth": []
  948. }
  949. ],
  950. "parameters": [
  951. {
  952. "name": "OCS-APIRequest",
  953. "in": "header",
  954. "description": "Required to be true for the API request to pass",
  955. "required": true,
  956. "schema": {
  957. "type": "boolean",
  958. "default": true
  959. }
  960. }
  961. ],
  962. "responses": {
  963. "200": {
  964. "description": "Available templates returned",
  965. "content": {
  966. "application/json": {
  967. "schema": {
  968. "type": "object",
  969. "required": [
  970. "ocs"
  971. ],
  972. "properties": {
  973. "ocs": {
  974. "type": "object",
  975. "required": [
  976. "meta",
  977. "data"
  978. ],
  979. "properties": {
  980. "meta": {
  981. "$ref": "#/components/schemas/OCSMeta"
  982. },
  983. "data": {
  984. "type": "array",
  985. "items": {
  986. "$ref": "#/components/schemas/TemplateFileCreator"
  987. }
  988. }
  989. }
  990. }
  991. }
  992. }
  993. }
  994. }
  995. }
  996. }
  997. }
  998. },
  999. "/ocs/v2.php/apps/files/api/v1/templates/create": {
  1000. "post": {
  1001. "operationId": "template-create",
  1002. "summary": "Create a template",
  1003. "tags": [
  1004. "template"
  1005. ],
  1006. "security": [
  1007. {
  1008. "bearer_auth": []
  1009. },
  1010. {
  1011. "basic_auth": []
  1012. }
  1013. ],
  1014. "requestBody": {
  1015. "required": true,
  1016. "content": {
  1017. "application/json": {
  1018. "schema": {
  1019. "type": "object",
  1020. "required": [
  1021. "filePath"
  1022. ],
  1023. "properties": {
  1024. "filePath": {
  1025. "type": "string",
  1026. "description": "Path of the file"
  1027. },
  1028. "templatePath": {
  1029. "type": "string",
  1030. "default": "",
  1031. "description": "Name of the template"
  1032. },
  1033. "templateType": {
  1034. "type": "string",
  1035. "default": "user",
  1036. "description": "Type of the template"
  1037. }
  1038. }
  1039. }
  1040. }
  1041. }
  1042. },
  1043. "parameters": [
  1044. {
  1045. "name": "OCS-APIRequest",
  1046. "in": "header",
  1047. "description": "Required to be true for the API request to pass",
  1048. "required": true,
  1049. "schema": {
  1050. "type": "boolean",
  1051. "default": true
  1052. }
  1053. }
  1054. ],
  1055. "responses": {
  1056. "200": {
  1057. "description": "Template created successfully",
  1058. "content": {
  1059. "application/json": {
  1060. "schema": {
  1061. "type": "object",
  1062. "required": [
  1063. "ocs"
  1064. ],
  1065. "properties": {
  1066. "ocs": {
  1067. "type": "object",
  1068. "required": [
  1069. "meta",
  1070. "data"
  1071. ],
  1072. "properties": {
  1073. "meta": {
  1074. "$ref": "#/components/schemas/OCSMeta"
  1075. },
  1076. "data": {
  1077. "$ref": "#/components/schemas/TemplateFile"
  1078. }
  1079. }
  1080. }
  1081. }
  1082. }
  1083. }
  1084. }
  1085. },
  1086. "403": {
  1087. "description": "Creating template is not allowed",
  1088. "content": {
  1089. "application/json": {
  1090. "schema": {
  1091. "type": "object",
  1092. "required": [
  1093. "ocs"
  1094. ],
  1095. "properties": {
  1096. "ocs": {
  1097. "type": "object",
  1098. "required": [
  1099. "meta",
  1100. "data"
  1101. ],
  1102. "properties": {
  1103. "meta": {
  1104. "$ref": "#/components/schemas/OCSMeta"
  1105. },
  1106. "data": {}
  1107. }
  1108. }
  1109. }
  1110. }
  1111. }
  1112. }
  1113. }
  1114. }
  1115. }
  1116. },
  1117. "/ocs/v2.php/apps/files/api/v1/templates/path": {
  1118. "post": {
  1119. "operationId": "template-path",
  1120. "summary": "Initialize the template directory",
  1121. "tags": [
  1122. "template"
  1123. ],
  1124. "security": [
  1125. {
  1126. "bearer_auth": []
  1127. },
  1128. {
  1129. "basic_auth": []
  1130. }
  1131. ],
  1132. "requestBody": {
  1133. "required": false,
  1134. "content": {
  1135. "application/json": {
  1136. "schema": {
  1137. "type": "object",
  1138. "properties": {
  1139. "templatePath": {
  1140. "type": "string",
  1141. "default": "",
  1142. "description": "Path of the template directory"
  1143. },
  1144. "copySystemTemplates": {
  1145. "type": "boolean",
  1146. "default": false,
  1147. "description": "Whether to copy the system templates to the template directory"
  1148. }
  1149. }
  1150. }
  1151. }
  1152. }
  1153. },
  1154. "parameters": [
  1155. {
  1156. "name": "OCS-APIRequest",
  1157. "in": "header",
  1158. "description": "Required to be true for the API request to pass",
  1159. "required": true,
  1160. "schema": {
  1161. "type": "boolean",
  1162. "default": true
  1163. }
  1164. }
  1165. ],
  1166. "responses": {
  1167. "200": {
  1168. "description": "Template directory initialized successfully",
  1169. "content": {
  1170. "application/json": {
  1171. "schema": {
  1172. "type": "object",
  1173. "required": [
  1174. "ocs"
  1175. ],
  1176. "properties": {
  1177. "ocs": {
  1178. "type": "object",
  1179. "required": [
  1180. "meta",
  1181. "data"
  1182. ],
  1183. "properties": {
  1184. "meta": {
  1185. "$ref": "#/components/schemas/OCSMeta"
  1186. },
  1187. "data": {
  1188. "type": "object",
  1189. "required": [
  1190. "template_path",
  1191. "templates"
  1192. ],
  1193. "properties": {
  1194. "template_path": {
  1195. "type": "string"
  1196. },
  1197. "templates": {
  1198. "type": "array",
  1199. "items": {
  1200. "$ref": "#/components/schemas/TemplateFileCreator"
  1201. }
  1202. }
  1203. }
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. }
  1210. }
  1211. },
  1212. "403": {
  1213. "description": "Initializing the template directory is not allowed",
  1214. "content": {
  1215. "application/json": {
  1216. "schema": {
  1217. "type": "object",
  1218. "required": [
  1219. "ocs"
  1220. ],
  1221. "properties": {
  1222. "ocs": {
  1223. "type": "object",
  1224. "required": [
  1225. "meta",
  1226. "data"
  1227. ],
  1228. "properties": {
  1229. "meta": {
  1230. "$ref": "#/components/schemas/OCSMeta"
  1231. },
  1232. "data": {}
  1233. }
  1234. }
  1235. }
  1236. }
  1237. }
  1238. }
  1239. }
  1240. }
  1241. }
  1242. },
  1243. "/ocs/v2.php/apps/files/api/v1/transferownership": {
  1244. "post": {
  1245. "operationId": "transfer_ownership-transfer",
  1246. "summary": "Transfer the ownership to another user",
  1247. "tags": [
  1248. "transfer_ownership"
  1249. ],
  1250. "security": [
  1251. {
  1252. "bearer_auth": []
  1253. },
  1254. {
  1255. "basic_auth": []
  1256. }
  1257. ],
  1258. "requestBody": {
  1259. "required": true,
  1260. "content": {
  1261. "application/json": {
  1262. "schema": {
  1263. "type": "object",
  1264. "required": [
  1265. "recipient",
  1266. "path"
  1267. ],
  1268. "properties": {
  1269. "recipient": {
  1270. "type": "string",
  1271. "description": "Username of the recipient"
  1272. },
  1273. "path": {
  1274. "type": "string",
  1275. "description": "Path of the file"
  1276. }
  1277. }
  1278. }
  1279. }
  1280. }
  1281. },
  1282. "parameters": [
  1283. {
  1284. "name": "OCS-APIRequest",
  1285. "in": "header",
  1286. "description": "Required to be true for the API request to pass",
  1287. "required": true,
  1288. "schema": {
  1289. "type": "boolean",
  1290. "default": true
  1291. }
  1292. }
  1293. ],
  1294. "responses": {
  1295. "200": {
  1296. "description": "Ownership transferred successfully",
  1297. "content": {
  1298. "application/json": {
  1299. "schema": {
  1300. "type": "object",
  1301. "required": [
  1302. "ocs"
  1303. ],
  1304. "properties": {
  1305. "ocs": {
  1306. "type": "object",
  1307. "required": [
  1308. "meta",
  1309. "data"
  1310. ],
  1311. "properties": {
  1312. "meta": {
  1313. "$ref": "#/components/schemas/OCSMeta"
  1314. },
  1315. "data": {}
  1316. }
  1317. }
  1318. }
  1319. }
  1320. }
  1321. }
  1322. },
  1323. "400": {
  1324. "description": "Transferring ownership is not possible",
  1325. "content": {
  1326. "application/json": {
  1327. "schema": {
  1328. "type": "object",
  1329. "required": [
  1330. "ocs"
  1331. ],
  1332. "properties": {
  1333. "ocs": {
  1334. "type": "object",
  1335. "required": [
  1336. "meta",
  1337. "data"
  1338. ],
  1339. "properties": {
  1340. "meta": {
  1341. "$ref": "#/components/schemas/OCSMeta"
  1342. },
  1343. "data": {}
  1344. }
  1345. }
  1346. }
  1347. }
  1348. }
  1349. }
  1350. },
  1351. "403": {
  1352. "description": "Transferring ownership is not allowed",
  1353. "content": {
  1354. "application/json": {
  1355. "schema": {
  1356. "type": "object",
  1357. "required": [
  1358. "ocs"
  1359. ],
  1360. "properties": {
  1361. "ocs": {
  1362. "type": "object",
  1363. "required": [
  1364. "meta",
  1365. "data"
  1366. ],
  1367. "properties": {
  1368. "meta": {
  1369. "$ref": "#/components/schemas/OCSMeta"
  1370. },
  1371. "data": {}
  1372. }
  1373. }
  1374. }
  1375. }
  1376. }
  1377. }
  1378. }
  1379. }
  1380. }
  1381. },
  1382. "/ocs/v2.php/apps/files/api/v1/transferownership/{id}": {
  1383. "post": {
  1384. "operationId": "transfer_ownership-accept",
  1385. "summary": "Accept an ownership transfer",
  1386. "tags": [
  1387. "transfer_ownership"
  1388. ],
  1389. "security": [
  1390. {
  1391. "bearer_auth": []
  1392. },
  1393. {
  1394. "basic_auth": []
  1395. }
  1396. ],
  1397. "parameters": [
  1398. {
  1399. "name": "id",
  1400. "in": "path",
  1401. "description": "ID of the ownership transfer",
  1402. "required": true,
  1403. "schema": {
  1404. "type": "integer",
  1405. "format": "int64"
  1406. }
  1407. },
  1408. {
  1409. "name": "OCS-APIRequest",
  1410. "in": "header",
  1411. "description": "Required to be true for the API request to pass",
  1412. "required": true,
  1413. "schema": {
  1414. "type": "boolean",
  1415. "default": true
  1416. }
  1417. }
  1418. ],
  1419. "responses": {
  1420. "200": {
  1421. "description": "Ownership transfer accepted successfully",
  1422. "content": {
  1423. "application/json": {
  1424. "schema": {
  1425. "type": "object",
  1426. "required": [
  1427. "ocs"
  1428. ],
  1429. "properties": {
  1430. "ocs": {
  1431. "type": "object",
  1432. "required": [
  1433. "meta",
  1434. "data"
  1435. ],
  1436. "properties": {
  1437. "meta": {
  1438. "$ref": "#/components/schemas/OCSMeta"
  1439. },
  1440. "data": {}
  1441. }
  1442. }
  1443. }
  1444. }
  1445. }
  1446. }
  1447. },
  1448. "403": {
  1449. "description": "Accepting ownership transfer is not allowed",
  1450. "content": {
  1451. "application/json": {
  1452. "schema": {
  1453. "type": "object",
  1454. "required": [
  1455. "ocs"
  1456. ],
  1457. "properties": {
  1458. "ocs": {
  1459. "type": "object",
  1460. "required": [
  1461. "meta",
  1462. "data"
  1463. ],
  1464. "properties": {
  1465. "meta": {
  1466. "$ref": "#/components/schemas/OCSMeta"
  1467. },
  1468. "data": {}
  1469. }
  1470. }
  1471. }
  1472. }
  1473. }
  1474. }
  1475. },
  1476. "404": {
  1477. "description": "Ownership transfer not found",
  1478. "content": {
  1479. "application/json": {
  1480. "schema": {
  1481. "type": "object",
  1482. "required": [
  1483. "ocs"
  1484. ],
  1485. "properties": {
  1486. "ocs": {
  1487. "type": "object",
  1488. "required": [
  1489. "meta",
  1490. "data"
  1491. ],
  1492. "properties": {
  1493. "meta": {
  1494. "$ref": "#/components/schemas/OCSMeta"
  1495. },
  1496. "data": {}
  1497. }
  1498. }
  1499. }
  1500. }
  1501. }
  1502. }
  1503. }
  1504. }
  1505. },
  1506. "delete": {
  1507. "operationId": "transfer_ownership-reject",
  1508. "summary": "Reject an ownership transfer",
  1509. "tags": [
  1510. "transfer_ownership"
  1511. ],
  1512. "security": [
  1513. {
  1514. "bearer_auth": []
  1515. },
  1516. {
  1517. "basic_auth": []
  1518. }
  1519. ],
  1520. "parameters": [
  1521. {
  1522. "name": "id",
  1523. "in": "path",
  1524. "description": "ID of the ownership transfer",
  1525. "required": true,
  1526. "schema": {
  1527. "type": "integer",
  1528. "format": "int64"
  1529. }
  1530. },
  1531. {
  1532. "name": "OCS-APIRequest",
  1533. "in": "header",
  1534. "description": "Required to be true for the API request to pass",
  1535. "required": true,
  1536. "schema": {
  1537. "type": "boolean",
  1538. "default": true
  1539. }
  1540. }
  1541. ],
  1542. "responses": {
  1543. "200": {
  1544. "description": "Ownership transfer rejected successfully",
  1545. "content": {
  1546. "application/json": {
  1547. "schema": {
  1548. "type": "object",
  1549. "required": [
  1550. "ocs"
  1551. ],
  1552. "properties": {
  1553. "ocs": {
  1554. "type": "object",
  1555. "required": [
  1556. "meta",
  1557. "data"
  1558. ],
  1559. "properties": {
  1560. "meta": {
  1561. "$ref": "#/components/schemas/OCSMeta"
  1562. },
  1563. "data": {}
  1564. }
  1565. }
  1566. }
  1567. }
  1568. }
  1569. }
  1570. },
  1571. "403": {
  1572. "description": "Rejecting ownership transfer is not allowed",
  1573. "content": {
  1574. "application/json": {
  1575. "schema": {
  1576. "type": "object",
  1577. "required": [
  1578. "ocs"
  1579. ],
  1580. "properties": {
  1581. "ocs": {
  1582. "type": "object",
  1583. "required": [
  1584. "meta",
  1585. "data"
  1586. ],
  1587. "properties": {
  1588. "meta": {
  1589. "$ref": "#/components/schemas/OCSMeta"
  1590. },
  1591. "data": {}
  1592. }
  1593. }
  1594. }
  1595. }
  1596. }
  1597. }
  1598. },
  1599. "404": {
  1600. "description": "Ownership transfer not found",
  1601. "content": {
  1602. "application/json": {
  1603. "schema": {
  1604. "type": "object",
  1605. "required": [
  1606. "ocs"
  1607. ],
  1608. "properties": {
  1609. "ocs": {
  1610. "type": "object",
  1611. "required": [
  1612. "meta",
  1613. "data"
  1614. ],
  1615. "properties": {
  1616. "meta": {
  1617. "$ref": "#/components/schemas/OCSMeta"
  1618. },
  1619. "data": {}
  1620. }
  1621. }
  1622. }
  1623. }
  1624. }
  1625. }
  1626. }
  1627. }
  1628. }
  1629. },
  1630. "/ocs/v2.php/apps/files/api/v1/openlocaleditor": {
  1631. "post": {
  1632. "operationId": "open_local_editor-create",
  1633. "summary": "Create a local editor",
  1634. "tags": [
  1635. "open_local_editor"
  1636. ],
  1637. "security": [
  1638. {
  1639. "bearer_auth": []
  1640. },
  1641. {
  1642. "basic_auth": []
  1643. }
  1644. ],
  1645. "requestBody": {
  1646. "required": true,
  1647. "content": {
  1648. "application/json": {
  1649. "schema": {
  1650. "type": "object",
  1651. "required": [
  1652. "path"
  1653. ],
  1654. "properties": {
  1655. "path": {
  1656. "type": "string",
  1657. "description": "Path of the file"
  1658. }
  1659. }
  1660. }
  1661. }
  1662. }
  1663. },
  1664. "parameters": [
  1665. {
  1666. "name": "OCS-APIRequest",
  1667. "in": "header",
  1668. "description": "Required to be true for the API request to pass",
  1669. "required": true,
  1670. "schema": {
  1671. "type": "boolean",
  1672. "default": true
  1673. }
  1674. }
  1675. ],
  1676. "responses": {
  1677. "200": {
  1678. "description": "Local editor returned",
  1679. "content": {
  1680. "application/json": {
  1681. "schema": {
  1682. "type": "object",
  1683. "required": [
  1684. "ocs"
  1685. ],
  1686. "properties": {
  1687. "ocs": {
  1688. "type": "object",
  1689. "required": [
  1690. "meta",
  1691. "data"
  1692. ],
  1693. "properties": {
  1694. "meta": {
  1695. "$ref": "#/components/schemas/OCSMeta"
  1696. },
  1697. "data": {
  1698. "type": "object",
  1699. "required": [
  1700. "userId",
  1701. "pathHash",
  1702. "expirationTime",
  1703. "token"
  1704. ],
  1705. "properties": {
  1706. "userId": {
  1707. "type": "string",
  1708. "nullable": true
  1709. },
  1710. "pathHash": {
  1711. "type": "string"
  1712. },
  1713. "expirationTime": {
  1714. "type": "integer",
  1715. "format": "int64"
  1716. },
  1717. "token": {
  1718. "type": "string"
  1719. }
  1720. }
  1721. }
  1722. }
  1723. }
  1724. }
  1725. }
  1726. }
  1727. }
  1728. },
  1729. "500": {
  1730. "description": "",
  1731. "content": {
  1732. "application/json": {
  1733. "schema": {
  1734. "type": "object",
  1735. "required": [
  1736. "ocs"
  1737. ],
  1738. "properties": {
  1739. "ocs": {
  1740. "type": "object",
  1741. "required": [
  1742. "meta",
  1743. "data"
  1744. ],
  1745. "properties": {
  1746. "meta": {
  1747. "$ref": "#/components/schemas/OCSMeta"
  1748. },
  1749. "data": {}
  1750. }
  1751. }
  1752. }
  1753. }
  1754. }
  1755. }
  1756. }
  1757. }
  1758. }
  1759. },
  1760. "/ocs/v2.php/apps/files/api/v1/openlocaleditor/{token}": {
  1761. "post": {
  1762. "operationId": "open_local_editor-validate",
  1763. "summary": "Validate a local editor",
  1764. "tags": [
  1765. "open_local_editor"
  1766. ],
  1767. "security": [
  1768. {
  1769. "bearer_auth": []
  1770. },
  1771. {
  1772. "basic_auth": []
  1773. }
  1774. ],
  1775. "requestBody": {
  1776. "required": true,
  1777. "content": {
  1778. "application/json": {
  1779. "schema": {
  1780. "type": "object",
  1781. "required": [
  1782. "path"
  1783. ],
  1784. "properties": {
  1785. "path": {
  1786. "type": "string",
  1787. "description": "Path of the file"
  1788. }
  1789. }
  1790. }
  1791. }
  1792. }
  1793. },
  1794. "parameters": [
  1795. {
  1796. "name": "token",
  1797. "in": "path",
  1798. "description": "Token of the local editor",
  1799. "required": true,
  1800. "schema": {
  1801. "type": "string"
  1802. }
  1803. },
  1804. {
  1805. "name": "OCS-APIRequest",
  1806. "in": "header",
  1807. "description": "Required to be true for the API request to pass",
  1808. "required": true,
  1809. "schema": {
  1810. "type": "boolean",
  1811. "default": true
  1812. }
  1813. }
  1814. ],
  1815. "responses": {
  1816. "200": {
  1817. "description": "Local editor validated successfully",
  1818. "content": {
  1819. "application/json": {
  1820. "schema": {
  1821. "type": "object",
  1822. "required": [
  1823. "ocs"
  1824. ],
  1825. "properties": {
  1826. "ocs": {
  1827. "type": "object",
  1828. "required": [
  1829. "meta",
  1830. "data"
  1831. ],
  1832. "properties": {
  1833. "meta": {
  1834. "$ref": "#/components/schemas/OCSMeta"
  1835. },
  1836. "data": {
  1837. "type": "object",
  1838. "required": [
  1839. "userId",
  1840. "pathHash",
  1841. "expirationTime",
  1842. "token"
  1843. ],
  1844. "properties": {
  1845. "userId": {
  1846. "type": "string"
  1847. },
  1848. "pathHash": {
  1849. "type": "string"
  1850. },
  1851. "expirationTime": {
  1852. "type": "integer",
  1853. "format": "int64"
  1854. },
  1855. "token": {
  1856. "type": "string"
  1857. }
  1858. }
  1859. }
  1860. }
  1861. }
  1862. }
  1863. }
  1864. }
  1865. }
  1866. },
  1867. "404": {
  1868. "description": "Local editor not found",
  1869. "content": {
  1870. "application/json": {
  1871. "schema": {
  1872. "type": "object",
  1873. "required": [
  1874. "ocs"
  1875. ],
  1876. "properties": {
  1877. "ocs": {
  1878. "type": "object",
  1879. "required": [
  1880. "meta",
  1881. "data"
  1882. ],
  1883. "properties": {
  1884. "meta": {
  1885. "$ref": "#/components/schemas/OCSMeta"
  1886. },
  1887. "data": {}
  1888. }
  1889. }
  1890. }
  1891. }
  1892. }
  1893. }
  1894. }
  1895. }
  1896. }
  1897. }
  1898. },
  1899. "tags": []
  1900. }