1
0

openapi.json 82 KB

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