openapi.json 82 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883
  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. "enum": [
  1177. 0,
  1178. 1
  1179. ]
  1180. }
  1181. },
  1182. {
  1183. "name": "OCS-APIRequest",
  1184. "in": "header",
  1185. "description": "Required to be true for the API request to pass",
  1186. "required": true,
  1187. "schema": {
  1188. "type": "boolean",
  1189. "default": true
  1190. }
  1191. }
  1192. ],
  1193. "responses": {
  1194. "200": {
  1195. "description": "Template directory initialized successfully",
  1196. "content": {
  1197. "application/json": {
  1198. "schema": {
  1199. "type": "object",
  1200. "required": [
  1201. "ocs"
  1202. ],
  1203. "properties": {
  1204. "ocs": {
  1205. "type": "object",
  1206. "required": [
  1207. "meta",
  1208. "data"
  1209. ],
  1210. "properties": {
  1211. "meta": {
  1212. "$ref": "#/components/schemas/OCSMeta"
  1213. },
  1214. "data": {
  1215. "type": "object",
  1216. "required": [
  1217. "template_path",
  1218. "templates"
  1219. ],
  1220. "properties": {
  1221. "template_path": {
  1222. "type": "string"
  1223. },
  1224. "templates": {
  1225. "type": "array",
  1226. "items": {
  1227. "$ref": "#/components/schemas/TemplateFileCreator"
  1228. }
  1229. }
  1230. }
  1231. }
  1232. }
  1233. }
  1234. }
  1235. }
  1236. }
  1237. }
  1238. },
  1239. "403": {
  1240. "description": "Initializing the template directory is not allowed",
  1241. "content": {
  1242. "text/plain": {
  1243. "schema": {
  1244. "type": "string"
  1245. }
  1246. }
  1247. }
  1248. }
  1249. }
  1250. }
  1251. },
  1252. "/ocs/v2.php/apps/files/api/v1/transferownership": {
  1253. "post": {
  1254. "operationId": "transfer_ownership-transfer",
  1255. "summary": "Transfer the ownership to another user",
  1256. "tags": [
  1257. "transfer_ownership"
  1258. ],
  1259. "security": [
  1260. {
  1261. "bearer_auth": []
  1262. },
  1263. {
  1264. "basic_auth": []
  1265. }
  1266. ],
  1267. "parameters": [
  1268. {
  1269. "name": "recipient",
  1270. "in": "query",
  1271. "description": "Username of the recipient",
  1272. "required": true,
  1273. "schema": {
  1274. "type": "string"
  1275. }
  1276. },
  1277. {
  1278. "name": "path",
  1279. "in": "query",
  1280. "description": "Path of the file",
  1281. "required": true,
  1282. "schema": {
  1283. "type": "string"
  1284. }
  1285. },
  1286. {
  1287. "name": "OCS-APIRequest",
  1288. "in": "header",
  1289. "description": "Required to be true for the API request to pass",
  1290. "required": true,
  1291. "schema": {
  1292. "type": "boolean",
  1293. "default": true
  1294. }
  1295. }
  1296. ],
  1297. "responses": {
  1298. "200": {
  1299. "description": "Ownership transferred successfully",
  1300. "content": {
  1301. "application/json": {
  1302. "schema": {
  1303. "type": "object",
  1304. "required": [
  1305. "ocs"
  1306. ],
  1307. "properties": {
  1308. "ocs": {
  1309. "type": "object",
  1310. "required": [
  1311. "meta",
  1312. "data"
  1313. ],
  1314. "properties": {
  1315. "meta": {
  1316. "$ref": "#/components/schemas/OCSMeta"
  1317. },
  1318. "data": {}
  1319. }
  1320. }
  1321. }
  1322. }
  1323. }
  1324. }
  1325. },
  1326. "400": {
  1327. "description": "Transferring ownership is not possible",
  1328. "content": {
  1329. "application/json": {
  1330. "schema": {
  1331. "type": "object",
  1332. "required": [
  1333. "ocs"
  1334. ],
  1335. "properties": {
  1336. "ocs": {
  1337. "type": "object",
  1338. "required": [
  1339. "meta",
  1340. "data"
  1341. ],
  1342. "properties": {
  1343. "meta": {
  1344. "$ref": "#/components/schemas/OCSMeta"
  1345. },
  1346. "data": {}
  1347. }
  1348. }
  1349. }
  1350. }
  1351. }
  1352. }
  1353. },
  1354. "403": {
  1355. "description": "Transferring ownership is not allowed",
  1356. "content": {
  1357. "application/json": {
  1358. "schema": {
  1359. "type": "object",
  1360. "required": [
  1361. "ocs"
  1362. ],
  1363. "properties": {
  1364. "ocs": {
  1365. "type": "object",
  1366. "required": [
  1367. "meta",
  1368. "data"
  1369. ],
  1370. "properties": {
  1371. "meta": {
  1372. "$ref": "#/components/schemas/OCSMeta"
  1373. },
  1374. "data": {}
  1375. }
  1376. }
  1377. }
  1378. }
  1379. }
  1380. }
  1381. }
  1382. }
  1383. }
  1384. },
  1385. "/ocs/v2.php/apps/files/api/v1/transferownership/{id}": {
  1386. "post": {
  1387. "operationId": "transfer_ownership-accept",
  1388. "summary": "Accept an ownership transfer",
  1389. "tags": [
  1390. "transfer_ownership"
  1391. ],
  1392. "security": [
  1393. {
  1394. "bearer_auth": []
  1395. },
  1396. {
  1397. "basic_auth": []
  1398. }
  1399. ],
  1400. "parameters": [
  1401. {
  1402. "name": "id",
  1403. "in": "path",
  1404. "description": "ID of the ownership transfer",
  1405. "required": true,
  1406. "schema": {
  1407. "type": "integer",
  1408. "format": "int64"
  1409. }
  1410. },
  1411. {
  1412. "name": "OCS-APIRequest",
  1413. "in": "header",
  1414. "description": "Required to be true for the API request to pass",
  1415. "required": true,
  1416. "schema": {
  1417. "type": "boolean",
  1418. "default": true
  1419. }
  1420. }
  1421. ],
  1422. "responses": {
  1423. "200": {
  1424. "description": "Ownership transfer accepted successfully",
  1425. "content": {
  1426. "application/json": {
  1427. "schema": {
  1428. "type": "object",
  1429. "required": [
  1430. "ocs"
  1431. ],
  1432. "properties": {
  1433. "ocs": {
  1434. "type": "object",
  1435. "required": [
  1436. "meta",
  1437. "data"
  1438. ],
  1439. "properties": {
  1440. "meta": {
  1441. "$ref": "#/components/schemas/OCSMeta"
  1442. },
  1443. "data": {}
  1444. }
  1445. }
  1446. }
  1447. }
  1448. }
  1449. }
  1450. },
  1451. "403": {
  1452. "description": "Accepting ownership transfer is not allowed",
  1453. "content": {
  1454. "application/json": {
  1455. "schema": {
  1456. "type": "object",
  1457. "required": [
  1458. "ocs"
  1459. ],
  1460. "properties": {
  1461. "ocs": {
  1462. "type": "object",
  1463. "required": [
  1464. "meta",
  1465. "data"
  1466. ],
  1467. "properties": {
  1468. "meta": {
  1469. "$ref": "#/components/schemas/OCSMeta"
  1470. },
  1471. "data": {}
  1472. }
  1473. }
  1474. }
  1475. }
  1476. }
  1477. }
  1478. },
  1479. "404": {
  1480. "description": "Ownership transfer not found",
  1481. "content": {
  1482. "application/json": {
  1483. "schema": {
  1484. "type": "object",
  1485. "required": [
  1486. "ocs"
  1487. ],
  1488. "properties": {
  1489. "ocs": {
  1490. "type": "object",
  1491. "required": [
  1492. "meta",
  1493. "data"
  1494. ],
  1495. "properties": {
  1496. "meta": {
  1497. "$ref": "#/components/schemas/OCSMeta"
  1498. },
  1499. "data": {}
  1500. }
  1501. }
  1502. }
  1503. }
  1504. }
  1505. }
  1506. }
  1507. }
  1508. },
  1509. "delete": {
  1510. "operationId": "transfer_ownership-reject",
  1511. "summary": "Reject an ownership transfer",
  1512. "tags": [
  1513. "transfer_ownership"
  1514. ],
  1515. "security": [
  1516. {
  1517. "bearer_auth": []
  1518. },
  1519. {
  1520. "basic_auth": []
  1521. }
  1522. ],
  1523. "parameters": [
  1524. {
  1525. "name": "id",
  1526. "in": "path",
  1527. "description": "ID of the ownership transfer",
  1528. "required": true,
  1529. "schema": {
  1530. "type": "integer",
  1531. "format": "int64"
  1532. }
  1533. },
  1534. {
  1535. "name": "OCS-APIRequest",
  1536. "in": "header",
  1537. "description": "Required to be true for the API request to pass",
  1538. "required": true,
  1539. "schema": {
  1540. "type": "boolean",
  1541. "default": true
  1542. }
  1543. }
  1544. ],
  1545. "responses": {
  1546. "200": {
  1547. "description": "Ownership transfer rejected successfully",
  1548. "content": {
  1549. "application/json": {
  1550. "schema": {
  1551. "type": "object",
  1552. "required": [
  1553. "ocs"
  1554. ],
  1555. "properties": {
  1556. "ocs": {
  1557. "type": "object",
  1558. "required": [
  1559. "meta",
  1560. "data"
  1561. ],
  1562. "properties": {
  1563. "meta": {
  1564. "$ref": "#/components/schemas/OCSMeta"
  1565. },
  1566. "data": {}
  1567. }
  1568. }
  1569. }
  1570. }
  1571. }
  1572. }
  1573. },
  1574. "403": {
  1575. "description": "Rejecting ownership transfer is not allowed",
  1576. "content": {
  1577. "application/json": {
  1578. "schema": {
  1579. "type": "object",
  1580. "required": [
  1581. "ocs"
  1582. ],
  1583. "properties": {
  1584. "ocs": {
  1585. "type": "object",
  1586. "required": [
  1587. "meta",
  1588. "data"
  1589. ],
  1590. "properties": {
  1591. "meta": {
  1592. "$ref": "#/components/schemas/OCSMeta"
  1593. },
  1594. "data": {}
  1595. }
  1596. }
  1597. }
  1598. }
  1599. }
  1600. }
  1601. },
  1602. "404": {
  1603. "description": "Ownership transfer not found",
  1604. "content": {
  1605. "application/json": {
  1606. "schema": {
  1607. "type": "object",
  1608. "required": [
  1609. "ocs"
  1610. ],
  1611. "properties": {
  1612. "ocs": {
  1613. "type": "object",
  1614. "required": [
  1615. "meta",
  1616. "data"
  1617. ],
  1618. "properties": {
  1619. "meta": {
  1620. "$ref": "#/components/schemas/OCSMeta"
  1621. },
  1622. "data": {}
  1623. }
  1624. }
  1625. }
  1626. }
  1627. }
  1628. }
  1629. }
  1630. }
  1631. }
  1632. },
  1633. "/ocs/v2.php/apps/files/api/v1/openlocaleditor": {
  1634. "post": {
  1635. "operationId": "open_local_editor-create",
  1636. "summary": "Create a local editor",
  1637. "tags": [
  1638. "open_local_editor"
  1639. ],
  1640. "security": [
  1641. {
  1642. "bearer_auth": []
  1643. },
  1644. {
  1645. "basic_auth": []
  1646. }
  1647. ],
  1648. "parameters": [
  1649. {
  1650. "name": "path",
  1651. "in": "query",
  1652. "description": "Path of the file",
  1653. "required": true,
  1654. "schema": {
  1655. "type": "string"
  1656. }
  1657. },
  1658. {
  1659. "name": "OCS-APIRequest",
  1660. "in": "header",
  1661. "description": "Required to be true for the API request to pass",
  1662. "required": true,
  1663. "schema": {
  1664. "type": "boolean",
  1665. "default": true
  1666. }
  1667. }
  1668. ],
  1669. "responses": {
  1670. "200": {
  1671. "description": "Local editor returned",
  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. "type": "object",
  1692. "required": [
  1693. "userId",
  1694. "pathHash",
  1695. "expirationTime",
  1696. "token"
  1697. ],
  1698. "properties": {
  1699. "userId": {
  1700. "type": "string",
  1701. "nullable": true
  1702. },
  1703. "pathHash": {
  1704. "type": "string"
  1705. },
  1706. "expirationTime": {
  1707. "type": "integer",
  1708. "format": "int64"
  1709. },
  1710. "token": {
  1711. "type": "string"
  1712. }
  1713. }
  1714. }
  1715. }
  1716. }
  1717. }
  1718. }
  1719. }
  1720. }
  1721. },
  1722. "500": {
  1723. "description": "",
  1724. "content": {
  1725. "application/json": {
  1726. "schema": {
  1727. "type": "object",
  1728. "required": [
  1729. "ocs"
  1730. ],
  1731. "properties": {
  1732. "ocs": {
  1733. "type": "object",
  1734. "required": [
  1735. "meta",
  1736. "data"
  1737. ],
  1738. "properties": {
  1739. "meta": {
  1740. "$ref": "#/components/schemas/OCSMeta"
  1741. },
  1742. "data": {}
  1743. }
  1744. }
  1745. }
  1746. }
  1747. }
  1748. }
  1749. }
  1750. }
  1751. }
  1752. },
  1753. "/ocs/v2.php/apps/files/api/v1/openlocaleditor/{token}": {
  1754. "post": {
  1755. "operationId": "open_local_editor-validate",
  1756. "summary": "Validate a local editor",
  1757. "tags": [
  1758. "open_local_editor"
  1759. ],
  1760. "security": [
  1761. {
  1762. "bearer_auth": []
  1763. },
  1764. {
  1765. "basic_auth": []
  1766. }
  1767. ],
  1768. "parameters": [
  1769. {
  1770. "name": "path",
  1771. "in": "query",
  1772. "description": "Path of the file",
  1773. "required": true,
  1774. "schema": {
  1775. "type": "string"
  1776. }
  1777. },
  1778. {
  1779. "name": "token",
  1780. "in": "path",
  1781. "description": "Token of the local editor",
  1782. "required": true,
  1783. "schema": {
  1784. "type": "string"
  1785. }
  1786. },
  1787. {
  1788. "name": "OCS-APIRequest",
  1789. "in": "header",
  1790. "description": "Required to be true for the API request to pass",
  1791. "required": true,
  1792. "schema": {
  1793. "type": "boolean",
  1794. "default": true
  1795. }
  1796. }
  1797. ],
  1798. "responses": {
  1799. "200": {
  1800. "description": "Local editor validated successfully",
  1801. "content": {
  1802. "application/json": {
  1803. "schema": {
  1804. "type": "object",
  1805. "required": [
  1806. "ocs"
  1807. ],
  1808. "properties": {
  1809. "ocs": {
  1810. "type": "object",
  1811. "required": [
  1812. "meta",
  1813. "data"
  1814. ],
  1815. "properties": {
  1816. "meta": {
  1817. "$ref": "#/components/schemas/OCSMeta"
  1818. },
  1819. "data": {
  1820. "type": "object",
  1821. "required": [
  1822. "userId",
  1823. "pathHash",
  1824. "expirationTime",
  1825. "token"
  1826. ],
  1827. "properties": {
  1828. "userId": {
  1829. "type": "string"
  1830. },
  1831. "pathHash": {
  1832. "type": "string"
  1833. },
  1834. "expirationTime": {
  1835. "type": "integer",
  1836. "format": "int64"
  1837. },
  1838. "token": {
  1839. "type": "string"
  1840. }
  1841. }
  1842. }
  1843. }
  1844. }
  1845. }
  1846. }
  1847. }
  1848. }
  1849. },
  1850. "404": {
  1851. "description": "Local editor not found",
  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. }
  1872. }
  1873. }
  1874. }
  1875. }
  1876. }
  1877. }
  1878. }
  1879. }
  1880. }
  1881. },
  1882. "tags": []
  1883. }