openapi.json 30 KB

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