openapi.json 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  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. }
  158. },
  159. "paths": {
  160. "/ocs/v2.php/apps/dav/api/v1/direct": {
  161. "post": {
  162. "operationId": "direct-get-url",
  163. "summary": "Get a direct link to a file",
  164. "tags": [
  165. "direct"
  166. ],
  167. "security": [
  168. {
  169. "bearer_auth": []
  170. },
  171. {
  172. "basic_auth": []
  173. }
  174. ],
  175. "requestBody": {
  176. "required": true,
  177. "content": {
  178. "application/json": {
  179. "schema": {
  180. "type": "object",
  181. "required": [
  182. "fileId",
  183. "expirationTime"
  184. ],
  185. "properties": {
  186. "fileId": {
  187. "type": "integer",
  188. "format": "int64",
  189. "description": "ID of the file"
  190. },
  191. "expirationTime": {
  192. "type": "integer",
  193. "format": "int64",
  194. "description": "Duration until the link expires"
  195. }
  196. }
  197. }
  198. }
  199. }
  200. },
  201. "parameters": [
  202. {
  203. "name": "OCS-APIRequest",
  204. "in": "header",
  205. "description": "Required to be true for the API request to pass",
  206. "required": true,
  207. "schema": {
  208. "type": "boolean",
  209. "default": true
  210. }
  211. }
  212. ],
  213. "responses": {
  214. "200": {
  215. "description": "Direct link returned",
  216. "content": {
  217. "application/json": {
  218. "schema": {
  219. "type": "object",
  220. "required": [
  221. "ocs"
  222. ],
  223. "properties": {
  224. "ocs": {
  225. "type": "object",
  226. "required": [
  227. "meta",
  228. "data"
  229. ],
  230. "properties": {
  231. "meta": {
  232. "$ref": "#/components/schemas/OCSMeta"
  233. },
  234. "data": {
  235. "type": "object",
  236. "required": [
  237. "url"
  238. ],
  239. "properties": {
  240. "url": {
  241. "type": "string"
  242. }
  243. }
  244. }
  245. }
  246. }
  247. }
  248. }
  249. }
  250. }
  251. },
  252. "404": {
  253. "description": "File not found",
  254. "content": {
  255. "application/json": {
  256. "schema": {
  257. "type": "object",
  258. "required": [
  259. "ocs"
  260. ],
  261. "properties": {
  262. "ocs": {
  263. "type": "object",
  264. "required": [
  265. "meta",
  266. "data"
  267. ],
  268. "properties": {
  269. "meta": {
  270. "$ref": "#/components/schemas/OCSMeta"
  271. },
  272. "data": {}
  273. }
  274. }
  275. }
  276. }
  277. }
  278. }
  279. },
  280. "400": {
  281. "description": "Getting direct link is not possible",
  282. "content": {
  283. "application/json": {
  284. "schema": {
  285. "type": "object",
  286. "required": [
  287. "ocs"
  288. ],
  289. "properties": {
  290. "ocs": {
  291. "type": "object",
  292. "required": [
  293. "meta",
  294. "data"
  295. ],
  296. "properties": {
  297. "meta": {
  298. "$ref": "#/components/schemas/OCSMeta"
  299. },
  300. "data": {}
  301. }
  302. }
  303. }
  304. }
  305. }
  306. }
  307. },
  308. "403": {
  309. "description": "Missing permissions to get direct link",
  310. "content": {
  311. "application/json": {
  312. "schema": {
  313. "type": "object",
  314. "required": [
  315. "ocs"
  316. ],
  317. "properties": {
  318. "ocs": {
  319. "type": "object",
  320. "required": [
  321. "meta",
  322. "data"
  323. ],
  324. "properties": {
  325. "meta": {
  326. "$ref": "#/components/schemas/OCSMeta"
  327. },
  328. "data": {}
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. }
  336. }
  337. }
  338. },
  339. "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}/now": {
  340. "get": {
  341. "operationId": "out_of_office-get-current-out-of-office-data",
  342. "summary": "Get the currently configured out-of-office data of a user",
  343. "tags": [
  344. "out_of_office"
  345. ],
  346. "security": [
  347. {
  348. "bearer_auth": []
  349. },
  350. {
  351. "basic_auth": []
  352. }
  353. ],
  354. "parameters": [
  355. {
  356. "name": "userId",
  357. "in": "path",
  358. "description": "The user id to get out-of-office data for.",
  359. "required": true,
  360. "schema": {
  361. "type": "string"
  362. }
  363. },
  364. {
  365. "name": "OCS-APIRequest",
  366. "in": "header",
  367. "description": "Required to be true for the API request to pass",
  368. "required": true,
  369. "schema": {
  370. "type": "boolean",
  371. "default": true
  372. }
  373. }
  374. ],
  375. "responses": {
  376. "200": {
  377. "description": "Out-of-office data",
  378. "content": {
  379. "application/json": {
  380. "schema": {
  381. "type": "object",
  382. "required": [
  383. "ocs"
  384. ],
  385. "properties": {
  386. "ocs": {
  387. "type": "object",
  388. "required": [
  389. "meta",
  390. "data"
  391. ],
  392. "properties": {
  393. "meta": {
  394. "$ref": "#/components/schemas/OCSMeta"
  395. },
  396. "data": {
  397. "$ref": "#/components/schemas/CurrentOutOfOfficeData"
  398. }
  399. }
  400. }
  401. }
  402. }
  403. }
  404. }
  405. },
  406. "404": {
  407. "description": "No out-of-office data was found",
  408. "content": {
  409. "application/json": {
  410. "schema": {
  411. "type": "object",
  412. "required": [
  413. "ocs"
  414. ],
  415. "properties": {
  416. "ocs": {
  417. "type": "object",
  418. "required": [
  419. "meta",
  420. "data"
  421. ],
  422. "properties": {
  423. "meta": {
  424. "$ref": "#/components/schemas/OCSMeta"
  425. },
  426. "data": {
  427. "nullable": true
  428. }
  429. }
  430. }
  431. }
  432. }
  433. }
  434. }
  435. }
  436. }
  437. }
  438. },
  439. "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}": {
  440. "get": {
  441. "operationId": "out_of_office-get-out-of-office",
  442. "summary": "Get the configured out-of-office data of a user.",
  443. "tags": [
  444. "out_of_office"
  445. ],
  446. "security": [
  447. {
  448. "bearer_auth": []
  449. },
  450. {
  451. "basic_auth": []
  452. }
  453. ],
  454. "parameters": [
  455. {
  456. "name": "userId",
  457. "in": "path",
  458. "description": "The user id to get out-of-office data for.",
  459. "required": true,
  460. "schema": {
  461. "type": "string"
  462. }
  463. },
  464. {
  465. "name": "OCS-APIRequest",
  466. "in": "header",
  467. "description": "Required to be true for the API request to pass",
  468. "required": true,
  469. "schema": {
  470. "type": "boolean",
  471. "default": true
  472. }
  473. }
  474. ],
  475. "responses": {
  476. "200": {
  477. "description": "Out-of-office data",
  478. "content": {
  479. "application/json": {
  480. "schema": {
  481. "type": "object",
  482. "required": [
  483. "ocs"
  484. ],
  485. "properties": {
  486. "ocs": {
  487. "type": "object",
  488. "required": [
  489. "meta",
  490. "data"
  491. ],
  492. "properties": {
  493. "meta": {
  494. "$ref": "#/components/schemas/OCSMeta"
  495. },
  496. "data": {
  497. "$ref": "#/components/schemas/OutOfOfficeData"
  498. }
  499. }
  500. }
  501. }
  502. }
  503. }
  504. }
  505. },
  506. "404": {
  507. "description": "No out-of-office data was found",
  508. "content": {
  509. "application/json": {
  510. "schema": {
  511. "type": "object",
  512. "required": [
  513. "ocs"
  514. ],
  515. "properties": {
  516. "ocs": {
  517. "type": "object",
  518. "required": [
  519. "meta",
  520. "data"
  521. ],
  522. "properties": {
  523. "meta": {
  524. "$ref": "#/components/schemas/OCSMeta"
  525. },
  526. "data": {
  527. "nullable": true
  528. }
  529. }
  530. }
  531. }
  532. }
  533. }
  534. }
  535. }
  536. }
  537. },
  538. "post": {
  539. "operationId": "out_of_office-set-out-of-office",
  540. "summary": "Set out-of-office absence",
  541. "tags": [
  542. "out_of_office"
  543. ],
  544. "security": [
  545. {
  546. "bearer_auth": []
  547. },
  548. {
  549. "basic_auth": []
  550. }
  551. ],
  552. "requestBody": {
  553. "required": true,
  554. "content": {
  555. "application/json": {
  556. "schema": {
  557. "type": "object",
  558. "required": [
  559. "firstDay",
  560. "lastDay",
  561. "status",
  562. "message"
  563. ],
  564. "properties": {
  565. "firstDay": {
  566. "type": "string",
  567. "description": "First day of the absence in format `YYYY-MM-DD`"
  568. },
  569. "lastDay": {
  570. "type": "string",
  571. "description": "Last day of the absence in format `YYYY-MM-DD`"
  572. },
  573. "status": {
  574. "type": "string",
  575. "description": "Short text that is set as user status during the absence"
  576. },
  577. "message": {
  578. "type": "string",
  579. "description": "Longer multiline message that is shown to others during the absence"
  580. },
  581. "replacementUserId": {
  582. "type": "string",
  583. "nullable": true,
  584. "description": "User id of the replacement user"
  585. },
  586. "replacementUserDisplayName": {
  587. "type": "string",
  588. "nullable": true,
  589. "description": "Display name of the replacement user"
  590. }
  591. }
  592. }
  593. }
  594. }
  595. },
  596. "parameters": [
  597. {
  598. "name": "userId",
  599. "in": "path",
  600. "required": true,
  601. "schema": {
  602. "type": "string"
  603. }
  604. },
  605. {
  606. "name": "OCS-APIRequest",
  607. "in": "header",
  608. "description": "Required to be true for the API request to pass",
  609. "required": true,
  610. "schema": {
  611. "type": "boolean",
  612. "default": true
  613. }
  614. }
  615. ],
  616. "responses": {
  617. "200": {
  618. "description": "Absence data",
  619. "content": {
  620. "application/json": {
  621. "schema": {
  622. "type": "object",
  623. "required": [
  624. "ocs"
  625. ],
  626. "properties": {
  627. "ocs": {
  628. "type": "object",
  629. "required": [
  630. "meta",
  631. "data"
  632. ],
  633. "properties": {
  634. "meta": {
  635. "$ref": "#/components/schemas/OCSMeta"
  636. },
  637. "data": {
  638. "$ref": "#/components/schemas/OutOfOfficeData"
  639. }
  640. }
  641. }
  642. }
  643. }
  644. }
  645. }
  646. },
  647. "400": {
  648. "description": "When the first day is not before the last day",
  649. "content": {
  650. "application/json": {
  651. "schema": {
  652. "type": "object",
  653. "required": [
  654. "ocs"
  655. ],
  656. "properties": {
  657. "ocs": {
  658. "type": "object",
  659. "required": [
  660. "meta",
  661. "data"
  662. ],
  663. "properties": {
  664. "meta": {
  665. "$ref": "#/components/schemas/OCSMeta"
  666. },
  667. "data": {
  668. "type": "object",
  669. "required": [
  670. "error"
  671. ],
  672. "properties": {
  673. "error": {
  674. "type": "string",
  675. "enum": [
  676. "firstDay"
  677. ]
  678. }
  679. }
  680. }
  681. }
  682. }
  683. }
  684. }
  685. }
  686. }
  687. },
  688. "401": {
  689. "description": "When the user is not logged in",
  690. "content": {
  691. "application/json": {
  692. "schema": {
  693. "type": "object",
  694. "required": [
  695. "ocs"
  696. ],
  697. "properties": {
  698. "ocs": {
  699. "type": "object",
  700. "required": [
  701. "meta",
  702. "data"
  703. ],
  704. "properties": {
  705. "meta": {
  706. "$ref": "#/components/schemas/OCSMeta"
  707. },
  708. "data": {
  709. "nullable": true
  710. }
  711. }
  712. }
  713. }
  714. }
  715. }
  716. }
  717. },
  718. "404": {
  719. "description": "When the replacementUserId was provided but replacement user was not found",
  720. "content": {
  721. "application/json": {
  722. "schema": {
  723. "type": "object",
  724. "required": [
  725. "ocs"
  726. ],
  727. "properties": {
  728. "ocs": {
  729. "type": "object",
  730. "required": [
  731. "meta",
  732. "data"
  733. ],
  734. "properties": {
  735. "meta": {
  736. "$ref": "#/components/schemas/OCSMeta"
  737. },
  738. "data": {
  739. "nullable": true
  740. }
  741. }
  742. }
  743. }
  744. }
  745. }
  746. }
  747. }
  748. }
  749. },
  750. "delete": {
  751. "operationId": "out_of_office-clear-out-of-office",
  752. "summary": "Clear the out-of-office",
  753. "tags": [
  754. "out_of_office"
  755. ],
  756. "security": [
  757. {
  758. "bearer_auth": []
  759. },
  760. {
  761. "basic_auth": []
  762. }
  763. ],
  764. "parameters": [
  765. {
  766. "name": "userId",
  767. "in": "path",
  768. "required": true,
  769. "schema": {
  770. "type": "string"
  771. }
  772. },
  773. {
  774. "name": "OCS-APIRequest",
  775. "in": "header",
  776. "description": "Required to be true for the API request to pass",
  777. "required": true,
  778. "schema": {
  779. "type": "boolean",
  780. "default": true
  781. }
  782. }
  783. ],
  784. "responses": {
  785. "200": {
  786. "description": "When the absence was cleared successfully",
  787. "content": {
  788. "application/json": {
  789. "schema": {
  790. "type": "object",
  791. "required": [
  792. "ocs"
  793. ],
  794. "properties": {
  795. "ocs": {
  796. "type": "object",
  797. "required": [
  798. "meta",
  799. "data"
  800. ],
  801. "properties": {
  802. "meta": {
  803. "$ref": "#/components/schemas/OCSMeta"
  804. },
  805. "data": {
  806. "nullable": true
  807. }
  808. }
  809. }
  810. }
  811. }
  812. }
  813. }
  814. },
  815. "401": {
  816. "description": "When the user is not logged in",
  817. "content": {
  818. "application/json": {
  819. "schema": {
  820. "type": "object",
  821. "required": [
  822. "ocs"
  823. ],
  824. "properties": {
  825. "ocs": {
  826. "type": "object",
  827. "required": [
  828. "meta",
  829. "data"
  830. ],
  831. "properties": {
  832. "meta": {
  833. "$ref": "#/components/schemas/OCSMeta"
  834. },
  835. "data": {
  836. "nullable": true
  837. }
  838. }
  839. }
  840. }
  841. }
  842. }
  843. }
  844. }
  845. }
  846. }
  847. }
  848. },
  849. "tags": []
  850. }