openapi.json 81 KB

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