1
0

openapi.json 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  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. "parameters": [
  386. {
  387. "name": "location",
  388. "in": "query",
  389. "description": "location/URL to filter by",
  390. "schema": {
  391. "type": "string",
  392. "nullable": true
  393. }
  394. },
  395. {
  396. "name": "OCS-APIRequest",
  397. "in": "header",
  398. "description": "Required to be true for the API request to pass",
  399. "required": true,
  400. "schema": {
  401. "type": "boolean",
  402. "default": true
  403. }
  404. }
  405. ],
  406. "responses": {
  407. "200": {
  408. "description": "Upcoming events",
  409. "content": {
  410. "application/json": {
  411. "schema": {
  412. "type": "object",
  413. "required": [
  414. "ocs"
  415. ],
  416. "properties": {
  417. "ocs": {
  418. "type": "object",
  419. "required": [
  420. "meta",
  421. "data"
  422. ],
  423. "properties": {
  424. "meta": {
  425. "$ref": "#/components/schemas/OCSMeta"
  426. },
  427. "data": {
  428. "type": "object",
  429. "required": [
  430. "events"
  431. ],
  432. "properties": {
  433. "events": {
  434. "type": "array",
  435. "items": {
  436. "$ref": "#/components/schemas/UpcomingEvent"
  437. }
  438. }
  439. }
  440. }
  441. }
  442. }
  443. }
  444. }
  445. }
  446. }
  447. },
  448. "401": {
  449. "description": "When not authenticated",
  450. "content": {
  451. "application/json": {
  452. "schema": {
  453. "type": "object",
  454. "required": [
  455. "ocs"
  456. ],
  457. "properties": {
  458. "ocs": {
  459. "type": "object",
  460. "required": [
  461. "meta",
  462. "data"
  463. ],
  464. "properties": {
  465. "meta": {
  466. "$ref": "#/components/schemas/OCSMeta"
  467. },
  468. "data": {
  469. "nullable": true
  470. }
  471. }
  472. }
  473. }
  474. }
  475. }
  476. }
  477. }
  478. }
  479. }
  480. },
  481. "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}/now": {
  482. "get": {
  483. "operationId": "out_of_office-get-current-out-of-office-data",
  484. "summary": "Get the currently configured out-of-office data of a user",
  485. "tags": [
  486. "out_of_office"
  487. ],
  488. "security": [
  489. {
  490. "bearer_auth": []
  491. },
  492. {
  493. "basic_auth": []
  494. }
  495. ],
  496. "parameters": [
  497. {
  498. "name": "userId",
  499. "in": "path",
  500. "description": "The user id to get out-of-office data for.",
  501. "required": true,
  502. "schema": {
  503. "type": "string"
  504. }
  505. },
  506. {
  507. "name": "OCS-APIRequest",
  508. "in": "header",
  509. "description": "Required to be true for the API request to pass",
  510. "required": true,
  511. "schema": {
  512. "type": "boolean",
  513. "default": true
  514. }
  515. }
  516. ],
  517. "responses": {
  518. "200": {
  519. "description": "Out-of-office data",
  520. "content": {
  521. "application/json": {
  522. "schema": {
  523. "type": "object",
  524. "required": [
  525. "ocs"
  526. ],
  527. "properties": {
  528. "ocs": {
  529. "type": "object",
  530. "required": [
  531. "meta",
  532. "data"
  533. ],
  534. "properties": {
  535. "meta": {
  536. "$ref": "#/components/schemas/OCSMeta"
  537. },
  538. "data": {
  539. "$ref": "#/components/schemas/CurrentOutOfOfficeData"
  540. }
  541. }
  542. }
  543. }
  544. }
  545. }
  546. }
  547. },
  548. "404": {
  549. "description": "No out-of-office data was found",
  550. "content": {
  551. "application/json": {
  552. "schema": {
  553. "type": "object",
  554. "required": [
  555. "ocs"
  556. ],
  557. "properties": {
  558. "ocs": {
  559. "type": "object",
  560. "required": [
  561. "meta",
  562. "data"
  563. ],
  564. "properties": {
  565. "meta": {
  566. "$ref": "#/components/schemas/OCSMeta"
  567. },
  568. "data": {
  569. "nullable": true
  570. }
  571. }
  572. }
  573. }
  574. }
  575. }
  576. }
  577. }
  578. }
  579. }
  580. },
  581. "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}": {
  582. "get": {
  583. "operationId": "out_of_office-get-out-of-office",
  584. "summary": "Get the configured out-of-office data of a user.",
  585. "tags": [
  586. "out_of_office"
  587. ],
  588. "security": [
  589. {
  590. "bearer_auth": []
  591. },
  592. {
  593. "basic_auth": []
  594. }
  595. ],
  596. "parameters": [
  597. {
  598. "name": "userId",
  599. "in": "path",
  600. "description": "The user id to get out-of-office data for.",
  601. "required": true,
  602. "schema": {
  603. "type": "string"
  604. }
  605. },
  606. {
  607. "name": "OCS-APIRequest",
  608. "in": "header",
  609. "description": "Required to be true for the API request to pass",
  610. "required": true,
  611. "schema": {
  612. "type": "boolean",
  613. "default": true
  614. }
  615. }
  616. ],
  617. "responses": {
  618. "200": {
  619. "description": "Out-of-office data",
  620. "content": {
  621. "application/json": {
  622. "schema": {
  623. "type": "object",
  624. "required": [
  625. "ocs"
  626. ],
  627. "properties": {
  628. "ocs": {
  629. "type": "object",
  630. "required": [
  631. "meta",
  632. "data"
  633. ],
  634. "properties": {
  635. "meta": {
  636. "$ref": "#/components/schemas/OCSMeta"
  637. },
  638. "data": {
  639. "$ref": "#/components/schemas/OutOfOfficeData"
  640. }
  641. }
  642. }
  643. }
  644. }
  645. }
  646. }
  647. },
  648. "404": {
  649. "description": "No out-of-office data was found",
  650. "content": {
  651. "application/json": {
  652. "schema": {
  653. "type": "object",
  654. "required": [
  655. "ocs"
  656. ],
  657. "properties": {
  658. "ocs": {
  659. "type": "object",
  660. "required": [
  661. "meta",
  662. "data"
  663. ],
  664. "properties": {
  665. "meta": {
  666. "$ref": "#/components/schemas/OCSMeta"
  667. },
  668. "data": {
  669. "nullable": true
  670. }
  671. }
  672. }
  673. }
  674. }
  675. }
  676. }
  677. }
  678. }
  679. },
  680. "post": {
  681. "operationId": "out_of_office-set-out-of-office",
  682. "summary": "Set out-of-office absence",
  683. "tags": [
  684. "out_of_office"
  685. ],
  686. "security": [
  687. {
  688. "bearer_auth": []
  689. },
  690. {
  691. "basic_auth": []
  692. }
  693. ],
  694. "requestBody": {
  695. "required": true,
  696. "content": {
  697. "application/json": {
  698. "schema": {
  699. "type": "object",
  700. "required": [
  701. "firstDay",
  702. "lastDay",
  703. "status",
  704. "message"
  705. ],
  706. "properties": {
  707. "firstDay": {
  708. "type": "string",
  709. "description": "First day of the absence in format `YYYY-MM-DD`"
  710. },
  711. "lastDay": {
  712. "type": "string",
  713. "description": "Last day of the absence in format `YYYY-MM-DD`"
  714. },
  715. "status": {
  716. "type": "string",
  717. "description": "Short text that is set as user status during the absence"
  718. },
  719. "message": {
  720. "type": "string",
  721. "description": "Longer multiline message that is shown to others during the absence"
  722. },
  723. "replacementUserId": {
  724. "type": "string",
  725. "nullable": true,
  726. "description": "User id of the replacement user"
  727. },
  728. "replacementUserDisplayName": {
  729. "type": "string",
  730. "nullable": true,
  731. "description": "Display name of the replacement user"
  732. }
  733. }
  734. }
  735. }
  736. }
  737. },
  738. "parameters": [
  739. {
  740. "name": "userId",
  741. "in": "path",
  742. "required": true,
  743. "schema": {
  744. "type": "string"
  745. }
  746. },
  747. {
  748. "name": "OCS-APIRequest",
  749. "in": "header",
  750. "description": "Required to be true for the API request to pass",
  751. "required": true,
  752. "schema": {
  753. "type": "boolean",
  754. "default": true
  755. }
  756. }
  757. ],
  758. "responses": {
  759. "200": {
  760. "description": "Absence data",
  761. "content": {
  762. "application/json": {
  763. "schema": {
  764. "type": "object",
  765. "required": [
  766. "ocs"
  767. ],
  768. "properties": {
  769. "ocs": {
  770. "type": "object",
  771. "required": [
  772. "meta",
  773. "data"
  774. ],
  775. "properties": {
  776. "meta": {
  777. "$ref": "#/components/schemas/OCSMeta"
  778. },
  779. "data": {
  780. "$ref": "#/components/schemas/OutOfOfficeData"
  781. }
  782. }
  783. }
  784. }
  785. }
  786. }
  787. }
  788. },
  789. "400": {
  790. "description": "When the first day is not before the last day",
  791. "content": {
  792. "application/json": {
  793. "schema": {
  794. "type": "object",
  795. "required": [
  796. "ocs"
  797. ],
  798. "properties": {
  799. "ocs": {
  800. "type": "object",
  801. "required": [
  802. "meta",
  803. "data"
  804. ],
  805. "properties": {
  806. "meta": {
  807. "$ref": "#/components/schemas/OCSMeta"
  808. },
  809. "data": {
  810. "type": "object",
  811. "required": [
  812. "error"
  813. ],
  814. "properties": {
  815. "error": {
  816. "type": "string",
  817. "enum": [
  818. "firstDay"
  819. ]
  820. }
  821. }
  822. }
  823. }
  824. }
  825. }
  826. }
  827. }
  828. }
  829. },
  830. "401": {
  831. "description": "When the user is not logged in",
  832. "content": {
  833. "application/json": {
  834. "schema": {
  835. "type": "object",
  836. "required": [
  837. "ocs"
  838. ],
  839. "properties": {
  840. "ocs": {
  841. "type": "object",
  842. "required": [
  843. "meta",
  844. "data"
  845. ],
  846. "properties": {
  847. "meta": {
  848. "$ref": "#/components/schemas/OCSMeta"
  849. },
  850. "data": {
  851. "nullable": true
  852. }
  853. }
  854. }
  855. }
  856. }
  857. }
  858. }
  859. },
  860. "404": {
  861. "description": "When the replacementUserId was provided but replacement user was not found",
  862. "content": {
  863. "application/json": {
  864. "schema": {
  865. "type": "object",
  866. "required": [
  867. "ocs"
  868. ],
  869. "properties": {
  870. "ocs": {
  871. "type": "object",
  872. "required": [
  873. "meta",
  874. "data"
  875. ],
  876. "properties": {
  877. "meta": {
  878. "$ref": "#/components/schemas/OCSMeta"
  879. },
  880. "data": {
  881. "nullable": true
  882. }
  883. }
  884. }
  885. }
  886. }
  887. }
  888. }
  889. }
  890. }
  891. },
  892. "delete": {
  893. "operationId": "out_of_office-clear-out-of-office",
  894. "summary": "Clear the out-of-office",
  895. "tags": [
  896. "out_of_office"
  897. ],
  898. "security": [
  899. {
  900. "bearer_auth": []
  901. },
  902. {
  903. "basic_auth": []
  904. }
  905. ],
  906. "parameters": [
  907. {
  908. "name": "userId",
  909. "in": "path",
  910. "required": true,
  911. "schema": {
  912. "type": "string"
  913. }
  914. },
  915. {
  916. "name": "OCS-APIRequest",
  917. "in": "header",
  918. "description": "Required to be true for the API request to pass",
  919. "required": true,
  920. "schema": {
  921. "type": "boolean",
  922. "default": true
  923. }
  924. }
  925. ],
  926. "responses": {
  927. "200": {
  928. "description": "When the absence was cleared successfully",
  929. "content": {
  930. "application/json": {
  931. "schema": {
  932. "type": "object",
  933. "required": [
  934. "ocs"
  935. ],
  936. "properties": {
  937. "ocs": {
  938. "type": "object",
  939. "required": [
  940. "meta",
  941. "data"
  942. ],
  943. "properties": {
  944. "meta": {
  945. "$ref": "#/components/schemas/OCSMeta"
  946. },
  947. "data": {
  948. "nullable": true
  949. }
  950. }
  951. }
  952. }
  953. }
  954. }
  955. }
  956. },
  957. "401": {
  958. "description": "When the user is not logged in",
  959. "content": {
  960. "application/json": {
  961. "schema": {
  962. "type": "object",
  963. "required": [
  964. "ocs"
  965. ],
  966. "properties": {
  967. "ocs": {
  968. "type": "object",
  969. "required": [
  970. "meta",
  971. "data"
  972. ],
  973. "properties": {
  974. "meta": {
  975. "$ref": "#/components/schemas/OCSMeta"
  976. },
  977. "data": {
  978. "nullable": true
  979. }
  980. }
  981. }
  982. }
  983. }
  984. }
  985. }
  986. }
  987. }
  988. }
  989. }
  990. },
  991. "tags": []
  992. }