1
0

openapi.json 83 KB

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