1
0

openapi.json 33 KB

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