1
0

openapi.json 80 KB

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