1
0

openapi.json 30 KB

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