openapi.json 81 KB

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