openapi.json 42 KB

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