openapi.json 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "dav",
  5. "version": "0.0.1",
  6. "description": "WebDAV endpoint",
  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. "dav"
  27. ],
  28. "properties": {
  29. "dav": {
  30. "type": "object",
  31. "required": [
  32. "chunking"
  33. ],
  34. "properties": {
  35. "chunking": {
  36. "type": "string"
  37. },
  38. "bulkupload": {
  39. "type": "string"
  40. }
  41. }
  42. }
  43. }
  44. },
  45. "CurrentOutOfOfficeData": {
  46. "allOf": [
  47. {
  48. "$ref": "#/components/schemas/OutOfOfficeDataCommon"
  49. },
  50. {
  51. "type": "object",
  52. "required": [
  53. "id",
  54. "startDate",
  55. "endDate",
  56. "shortMessage"
  57. ],
  58. "properties": {
  59. "id": {
  60. "type": "string"
  61. },
  62. "startDate": {
  63. "type": "integer",
  64. "format": "int64"
  65. },
  66. "endDate": {
  67. "type": "integer",
  68. "format": "int64"
  69. },
  70. "shortMessage": {
  71. "type": "string"
  72. }
  73. }
  74. }
  75. ]
  76. },
  77. "OCSMeta": {
  78. "type": "object",
  79. "required": [
  80. "status",
  81. "statuscode"
  82. ],
  83. "properties": {
  84. "status": {
  85. "type": "string"
  86. },
  87. "statuscode": {
  88. "type": "integer"
  89. },
  90. "message": {
  91. "type": "string"
  92. },
  93. "totalitems": {
  94. "type": "string"
  95. },
  96. "itemsperpage": {
  97. "type": "string"
  98. }
  99. }
  100. },
  101. "OutOfOfficeData": {
  102. "allOf": [
  103. {
  104. "$ref": "#/components/schemas/OutOfOfficeDataCommon"
  105. },
  106. {
  107. "type": "object",
  108. "required": [
  109. "id",
  110. "firstDay",
  111. "lastDay",
  112. "status"
  113. ],
  114. "properties": {
  115. "id": {
  116. "type": "integer",
  117. "format": "int64"
  118. },
  119. "firstDay": {
  120. "type": "string"
  121. },
  122. "lastDay": {
  123. "type": "string"
  124. },
  125. "status": {
  126. "type": "string"
  127. }
  128. }
  129. }
  130. ]
  131. },
  132. "OutOfOfficeDataCommon": {
  133. "type": "object",
  134. "required": [
  135. "userId",
  136. "message",
  137. "replacementUserId",
  138. "replacementUserDisplayName"
  139. ],
  140. "properties": {
  141. "userId": {
  142. "type": "string"
  143. },
  144. "message": {
  145. "type": "string"
  146. },
  147. "replacementUserId": {
  148. "type": "string",
  149. "nullable": true
  150. },
  151. "replacementUserDisplayName": {
  152. "type": "string",
  153. "nullable": true
  154. }
  155. }
  156. },
  157. "UpcomingEvent": {
  158. "type": "object",
  159. "required": [
  160. "uri",
  161. "calendarUri",
  162. "start",
  163. "summary",
  164. "location"
  165. ],
  166. "properties": {
  167. "uri": {
  168. "type": "string"
  169. },
  170. "calendarUri": {
  171. "type": "string"
  172. },
  173. "start": {
  174. "type": "integer",
  175. "format": "int64",
  176. "nullable": true
  177. },
  178. "summary": {
  179. "type": "string",
  180. "nullable": true
  181. },
  182. "location": {
  183. "type": "string",
  184. "nullable": true
  185. }
  186. }
  187. }
  188. }
  189. },
  190. "paths": {
  191. "/ocs/v2.php/apps/dav/api/v1/direct": {
  192. "post": {
  193. "operationId": "direct-get-url",
  194. "summary": "Get a direct link to a file",
  195. "tags": [
  196. "direct"
  197. ],
  198. "security": [
  199. {
  200. "bearer_auth": []
  201. },
  202. {
  203. "basic_auth": []
  204. }
  205. ],
  206. "requestBody": {
  207. "required": true,
  208. "content": {
  209. "application/json": {
  210. "schema": {
  211. "type": "object",
  212. "required": [
  213. "fileId",
  214. "expirationTime"
  215. ],
  216. "properties": {
  217. "fileId": {
  218. "type": "integer",
  219. "format": "int64",
  220. "description": "ID of the file"
  221. },
  222. "expirationTime": {
  223. "type": "integer",
  224. "format": "int64",
  225. "description": "Duration until the link expires"
  226. }
  227. }
  228. }
  229. }
  230. }
  231. },
  232. "parameters": [
  233. {
  234. "name": "OCS-APIRequest",
  235. "in": "header",
  236. "description": "Required to be true for the API request to pass",
  237. "required": true,
  238. "schema": {
  239. "type": "boolean",
  240. "default": true
  241. }
  242. }
  243. ],
  244. "responses": {
  245. "200": {
  246. "description": "Direct link returned",
  247. "content": {
  248. "application/json": {
  249. "schema": {
  250. "type": "object",
  251. "required": [
  252. "ocs"
  253. ],
  254. "properties": {
  255. "ocs": {
  256. "type": "object",
  257. "required": [
  258. "meta",
  259. "data"
  260. ],
  261. "properties": {
  262. "meta": {
  263. "$ref": "#/components/schemas/OCSMeta"
  264. },
  265. "data": {
  266. "type": "object",
  267. "required": [
  268. "url"
  269. ],
  270. "properties": {
  271. "url": {
  272. "type": "string"
  273. }
  274. }
  275. }
  276. }
  277. }
  278. }
  279. }
  280. }
  281. }
  282. },
  283. "404": {
  284. "description": "File not found",
  285. "content": {
  286. "application/json": {
  287. "schema": {
  288. "type": "object",
  289. "required": [
  290. "ocs"
  291. ],
  292. "properties": {
  293. "ocs": {
  294. "type": "object",
  295. "required": [
  296. "meta",
  297. "data"
  298. ],
  299. "properties": {
  300. "meta": {
  301. "$ref": "#/components/schemas/OCSMeta"
  302. },
  303. "data": {}
  304. }
  305. }
  306. }
  307. }
  308. }
  309. }
  310. },
  311. "400": {
  312. "description": "Getting direct link is not possible",
  313. "content": {
  314. "application/json": {
  315. "schema": {
  316. "type": "object",
  317. "required": [
  318. "ocs"
  319. ],
  320. "properties": {
  321. "ocs": {
  322. "type": "object",
  323. "required": [
  324. "meta",
  325. "data"
  326. ],
  327. "properties": {
  328. "meta": {
  329. "$ref": "#/components/schemas/OCSMeta"
  330. },
  331. "data": {}
  332. }
  333. }
  334. }
  335. }
  336. }
  337. }
  338. },
  339. "403": {
  340. "description": "Missing permissions to get direct link",
  341. "content": {
  342. "application/json": {
  343. "schema": {
  344. "type": "object",
  345. "required": [
  346. "ocs"
  347. ],
  348. "properties": {
  349. "ocs": {
  350. "type": "object",
  351. "required": [
  352. "meta",
  353. "data"
  354. ],
  355. "properties": {
  356. "meta": {
  357. "$ref": "#/components/schemas/OCSMeta"
  358. },
  359. "data": {}
  360. }
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. }
  369. },
  370. "/ocs/v2.php/apps/dav/api/v1/events/upcoming": {
  371. "get": {
  372. "operationId": "upcoming_events-get-events",
  373. "summary": "Get information about upcoming events",
  374. "tags": [
  375. "upcoming_events"
  376. ],
  377. "security": [
  378. {
  379. "bearer_auth": []
  380. },
  381. {
  382. "basic_auth": []
  383. }
  384. ],
  385. "requestBody": {
  386. "required": false,
  387. "content": {
  388. "application/json": {
  389. "schema": {
  390. "type": "object",
  391. "properties": {
  392. "location": {
  393. "type": "string",
  394. "nullable": true,
  395. "description": "location/URL to filter by"
  396. }
  397. }
  398. }
  399. }
  400. }
  401. },
  402. "parameters": [
  403. {
  404. "name": "OCS-APIRequest",
  405. "in": "header",
  406. "description": "Required to be true for the API request to pass",
  407. "required": true,
  408. "schema": {
  409. "type": "boolean",
  410. "default": true
  411. }
  412. }
  413. ],
  414. "responses": {
  415. "200": {
  416. "description": "Upcoming events",
  417. "content": {
  418. "application/json": {
  419. "schema": {
  420. "type": "object",
  421. "required": [
  422. "ocs"
  423. ],
  424. "properties": {
  425. "ocs": {
  426. "type": "object",
  427. "required": [
  428. "meta",
  429. "data"
  430. ],
  431. "properties": {
  432. "meta": {
  433. "$ref": "#/components/schemas/OCSMeta"
  434. },
  435. "data": {
  436. "type": "object",
  437. "required": [
  438. "events"
  439. ],
  440. "properties": {
  441. "events": {
  442. "type": "array",
  443. "items": {
  444. "$ref": "#/components/schemas/UpcomingEvent"
  445. }
  446. }
  447. }
  448. }
  449. }
  450. }
  451. }
  452. }
  453. }
  454. }
  455. },
  456. "401": {
  457. "description": "When not authenticated",
  458. "content": {
  459. "application/json": {
  460. "schema": {
  461. "type": "object",
  462. "required": [
  463. "ocs"
  464. ],
  465. "properties": {
  466. "ocs": {
  467. "type": "object",
  468. "required": [
  469. "meta",
  470. "data"
  471. ],
  472. "properties": {
  473. "meta": {
  474. "$ref": "#/components/schemas/OCSMeta"
  475. },
  476. "data": {
  477. "nullable": true
  478. }
  479. }
  480. }
  481. }
  482. }
  483. }
  484. }
  485. }
  486. }
  487. }
  488. },
  489. "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}/now": {
  490. "get": {
  491. "operationId": "out_of_office-get-current-out-of-office-data",
  492. "summary": "Get the currently configured out-of-office data of a user",
  493. "tags": [
  494. "out_of_office"
  495. ],
  496. "security": [
  497. {
  498. "bearer_auth": []
  499. },
  500. {
  501. "basic_auth": []
  502. }
  503. ],
  504. "parameters": [
  505. {
  506. "name": "userId",
  507. "in": "path",
  508. "description": "The user id to get out-of-office data for.",
  509. "required": true,
  510. "schema": {
  511. "type": "string"
  512. }
  513. },
  514. {
  515. "name": "OCS-APIRequest",
  516. "in": "header",
  517. "description": "Required to be true for the API request to pass",
  518. "required": true,
  519. "schema": {
  520. "type": "boolean",
  521. "default": true
  522. }
  523. }
  524. ],
  525. "responses": {
  526. "200": {
  527. "description": "Out-of-office data",
  528. "content": {
  529. "application/json": {
  530. "schema": {
  531. "type": "object",
  532. "required": [
  533. "ocs"
  534. ],
  535. "properties": {
  536. "ocs": {
  537. "type": "object",
  538. "required": [
  539. "meta",
  540. "data"
  541. ],
  542. "properties": {
  543. "meta": {
  544. "$ref": "#/components/schemas/OCSMeta"
  545. },
  546. "data": {
  547. "$ref": "#/components/schemas/CurrentOutOfOfficeData"
  548. }
  549. }
  550. }
  551. }
  552. }
  553. }
  554. }
  555. },
  556. "404": {
  557. "description": "No out-of-office data was found",
  558. "content": {
  559. "application/json": {
  560. "schema": {
  561. "type": "object",
  562. "required": [
  563. "ocs"
  564. ],
  565. "properties": {
  566. "ocs": {
  567. "type": "object",
  568. "required": [
  569. "meta",
  570. "data"
  571. ],
  572. "properties": {
  573. "meta": {
  574. "$ref": "#/components/schemas/OCSMeta"
  575. },
  576. "data": {
  577. "nullable": true
  578. }
  579. }
  580. }
  581. }
  582. }
  583. }
  584. }
  585. }
  586. }
  587. }
  588. },
  589. "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}": {
  590. "get": {
  591. "operationId": "out_of_office-get-out-of-office",
  592. "summary": "Get the configured out-of-office data of a user.",
  593. "tags": [
  594. "out_of_office"
  595. ],
  596. "security": [
  597. {
  598. "bearer_auth": []
  599. },
  600. {
  601. "basic_auth": []
  602. }
  603. ],
  604. "parameters": [
  605. {
  606. "name": "userId",
  607. "in": "path",
  608. "description": "The user id to get out-of-office data for.",
  609. "required": true,
  610. "schema": {
  611. "type": "string"
  612. }
  613. },
  614. {
  615. "name": "OCS-APIRequest",
  616. "in": "header",
  617. "description": "Required to be true for the API request to pass",
  618. "required": true,
  619. "schema": {
  620. "type": "boolean",
  621. "default": true
  622. }
  623. }
  624. ],
  625. "responses": {
  626. "200": {
  627. "description": "Out-of-office data",
  628. "content": {
  629. "application/json": {
  630. "schema": {
  631. "type": "object",
  632. "required": [
  633. "ocs"
  634. ],
  635. "properties": {
  636. "ocs": {
  637. "type": "object",
  638. "required": [
  639. "meta",
  640. "data"
  641. ],
  642. "properties": {
  643. "meta": {
  644. "$ref": "#/components/schemas/OCSMeta"
  645. },
  646. "data": {
  647. "$ref": "#/components/schemas/OutOfOfficeData"
  648. }
  649. }
  650. }
  651. }
  652. }
  653. }
  654. }
  655. },
  656. "404": {
  657. "description": "No out-of-office data was found",
  658. "content": {
  659. "application/json": {
  660. "schema": {
  661. "type": "object",
  662. "required": [
  663. "ocs"
  664. ],
  665. "properties": {
  666. "ocs": {
  667. "type": "object",
  668. "required": [
  669. "meta",
  670. "data"
  671. ],
  672. "properties": {
  673. "meta": {
  674. "$ref": "#/components/schemas/OCSMeta"
  675. },
  676. "data": {
  677. "nullable": true
  678. }
  679. }
  680. }
  681. }
  682. }
  683. }
  684. }
  685. }
  686. }
  687. },
  688. "post": {
  689. "operationId": "out_of_office-set-out-of-office",
  690. "summary": "Set out-of-office absence",
  691. "tags": [
  692. "out_of_office"
  693. ],
  694. "security": [
  695. {
  696. "bearer_auth": []
  697. },
  698. {
  699. "basic_auth": []
  700. }
  701. ],
  702. "requestBody": {
  703. "required": true,
  704. "content": {
  705. "application/json": {
  706. "schema": {
  707. "type": "object",
  708. "required": [
  709. "firstDay",
  710. "lastDay",
  711. "status",
  712. "message"
  713. ],
  714. "properties": {
  715. "firstDay": {
  716. "type": "string",
  717. "description": "First day of the absence in format `YYYY-MM-DD`"
  718. },
  719. "lastDay": {
  720. "type": "string",
  721. "description": "Last day of the absence in format `YYYY-MM-DD`"
  722. },
  723. "status": {
  724. "type": "string",
  725. "description": "Short text that is set as user status during the absence"
  726. },
  727. "message": {
  728. "type": "string",
  729. "description": "Longer multiline message that is shown to others during the absence"
  730. },
  731. "replacementUserId": {
  732. "type": "string",
  733. "nullable": true,
  734. "description": "User id of the replacement user"
  735. },
  736. "replacementUserDisplayName": {
  737. "type": "string",
  738. "nullable": true,
  739. "description": "Display name of the replacement user"
  740. }
  741. }
  742. }
  743. }
  744. }
  745. },
  746. "parameters": [
  747. {
  748. "name": "userId",
  749. "in": "path",
  750. "required": true,
  751. "schema": {
  752. "type": "string"
  753. }
  754. },
  755. {
  756. "name": "OCS-APIRequest",
  757. "in": "header",
  758. "description": "Required to be true for the API request to pass",
  759. "required": true,
  760. "schema": {
  761. "type": "boolean",
  762. "default": true
  763. }
  764. }
  765. ],
  766. "responses": {
  767. "200": {
  768. "description": "Absence data",
  769. "content": {
  770. "application/json": {
  771. "schema": {
  772. "type": "object",
  773. "required": [
  774. "ocs"
  775. ],
  776. "properties": {
  777. "ocs": {
  778. "type": "object",
  779. "required": [
  780. "meta",
  781. "data"
  782. ],
  783. "properties": {
  784. "meta": {
  785. "$ref": "#/components/schemas/OCSMeta"
  786. },
  787. "data": {
  788. "$ref": "#/components/schemas/OutOfOfficeData"
  789. }
  790. }
  791. }
  792. }
  793. }
  794. }
  795. }
  796. },
  797. "400": {
  798. "description": "When the first day is not before the last day",
  799. "content": {
  800. "application/json": {
  801. "schema": {
  802. "type": "object",
  803. "required": [
  804. "ocs"
  805. ],
  806. "properties": {
  807. "ocs": {
  808. "type": "object",
  809. "required": [
  810. "meta",
  811. "data"
  812. ],
  813. "properties": {
  814. "meta": {
  815. "$ref": "#/components/schemas/OCSMeta"
  816. },
  817. "data": {
  818. "type": "object",
  819. "required": [
  820. "error"
  821. ],
  822. "properties": {
  823. "error": {
  824. "type": "string",
  825. "enum": [
  826. "firstDay"
  827. ]
  828. }
  829. }
  830. }
  831. }
  832. }
  833. }
  834. }
  835. }
  836. }
  837. },
  838. "401": {
  839. "description": "When the user is not logged in",
  840. "content": {
  841. "application/json": {
  842. "schema": {
  843. "type": "object",
  844. "required": [
  845. "ocs"
  846. ],
  847. "properties": {
  848. "ocs": {
  849. "type": "object",
  850. "required": [
  851. "meta",
  852. "data"
  853. ],
  854. "properties": {
  855. "meta": {
  856. "$ref": "#/components/schemas/OCSMeta"
  857. },
  858. "data": {
  859. "nullable": true
  860. }
  861. }
  862. }
  863. }
  864. }
  865. }
  866. }
  867. },
  868. "404": {
  869. "description": "When the replacementUserId was provided but replacement user was not found",
  870. "content": {
  871. "application/json": {
  872. "schema": {
  873. "type": "object",
  874. "required": [
  875. "ocs"
  876. ],
  877. "properties": {
  878. "ocs": {
  879. "type": "object",
  880. "required": [
  881. "meta",
  882. "data"
  883. ],
  884. "properties": {
  885. "meta": {
  886. "$ref": "#/components/schemas/OCSMeta"
  887. },
  888. "data": {
  889. "nullable": true
  890. }
  891. }
  892. }
  893. }
  894. }
  895. }
  896. }
  897. }
  898. }
  899. },
  900. "delete": {
  901. "operationId": "out_of_office-clear-out-of-office",
  902. "summary": "Clear the out-of-office",
  903. "tags": [
  904. "out_of_office"
  905. ],
  906. "security": [
  907. {
  908. "bearer_auth": []
  909. },
  910. {
  911. "basic_auth": []
  912. }
  913. ],
  914. "parameters": [
  915. {
  916. "name": "userId",
  917. "in": "path",
  918. "required": true,
  919. "schema": {
  920. "type": "string"
  921. }
  922. },
  923. {
  924. "name": "OCS-APIRequest",
  925. "in": "header",
  926. "description": "Required to be true for the API request to pass",
  927. "required": true,
  928. "schema": {
  929. "type": "boolean",
  930. "default": true
  931. }
  932. }
  933. ],
  934. "responses": {
  935. "200": {
  936. "description": "When the absence was cleared successfully",
  937. "content": {
  938. "application/json": {
  939. "schema": {
  940. "type": "object",
  941. "required": [
  942. "ocs"
  943. ],
  944. "properties": {
  945. "ocs": {
  946. "type": "object",
  947. "required": [
  948. "meta",
  949. "data"
  950. ],
  951. "properties": {
  952. "meta": {
  953. "$ref": "#/components/schemas/OCSMeta"
  954. },
  955. "data": {
  956. "nullable": true
  957. }
  958. }
  959. }
  960. }
  961. }
  962. }
  963. }
  964. },
  965. "401": {
  966. "description": "When the user is not logged in",
  967. "content": {
  968. "application/json": {
  969. "schema": {
  970. "type": "object",
  971. "required": [
  972. "ocs"
  973. ],
  974. "properties": {
  975. "ocs": {
  976. "type": "object",
  977. "required": [
  978. "meta",
  979. "data"
  980. ],
  981. "properties": {
  982. "meta": {
  983. "$ref": "#/components/schemas/OCSMeta"
  984. },
  985. "data": {
  986. "nullable": true
  987. }
  988. }
  989. }
  990. }
  991. }
  992. }
  993. }
  994. }
  995. }
  996. }
  997. }
  998. },
  999. "tags": []
  1000. }