openapi.json 87 KB

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