From 77e458f765c2602ecf14d6ae1c69e9fe3afd7f5b Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Thu, 25 Jan 2024 17:22:40 +0100 Subject: [PATCH] group endpoints with tags Signed-off-by: Julien Veyssier --- lib/Controller/ApiController.php | 81 +- openapi.json | 8286 ++++++++++++++++++++++++++++++ 2 files changed, 8356 insertions(+), 11 deletions(-) create mode 100644 openapi.json diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 6ca9a2dc9..e51d38f30 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -24,7 +24,7 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\CORS; use OCP\AppFramework\Http\Attribute\NoAdminRequired; -use OCP\AppFramework\Http\ContentSecurityPolicy; +use OCP\AppFramework\Http\Attribute\OpenAPI; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; use OCP\Constants; @@ -76,45 +76,52 @@ public function __construct( } /** - * Delete user options + * Delete user settings * - * @return DataResponse + * @return DataResponse */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Settings'])] public function deleteOptionsValues(): DataResponse { $keys = $this->config->getUserKeys($this->userId, Application::APP_ID); foreach ($keys as $key) { $this->config->deleteUserValue($this->userId, Application::APP_ID, $key); } - return new DataResponse(['done' => true]); + return new DataResponse(''); } /** - * Save options values to the DB for current user + * Save setting values * - * @param array $options - * @return DataResponse + * Save setting values to the database for the current user + * + * @param array $options Array of setting key/values to save + * @return DataResponse * @throws PreConditionNotMetException */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Settings'])] public function saveOptionValues(array $options): DataResponse { foreach ($options as $key => $value) { $this->config->setUserValue($this->userId, Application::APP_ID, $key, $value); } - return new DataResponse(['done' => true]); + return new DataResponse(''); } /** - * get options values from the config for current user + * Get setting values + * + * Get setting values from the database for the current user * * @return DataResponse}, array{}> */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Settings'])] public function getOptionsValues(): DataResponse { $ov = []; $keys = $this->config->getUserKeys($this->userId, Application::APP_ID); @@ -128,7 +135,8 @@ public function getOptionsValues(): DataResponse { /** * Create a project - * Change for clients: response contains full project info + * + * Change for clients: response now contains full project info * * @param string $id * @param string $name @@ -141,6 +149,7 @@ public function getOptionsValues(): DataResponse { */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function createProject(string $id, string $name, ?string $contact_email = null): DataResponse { if ($contact_email !== null) { $email = $contact_email; @@ -167,6 +176,7 @@ public function createProject(string $id, string $name, ?string $contact_email = */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function getProjects(): DataResponse { return new DataResponse($this->projectService->getProjects($this->userId)); } @@ -183,6 +193,7 @@ public function getProjects(): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function getProjectInfo(string $projectId): DataResponse { $projectInfo = $this->projectService->getProjectInfo($projectId); $projectInfo['myaccesslevel'] = $this->projectService->getUserMaxAccessLevel($this->userId, $projectId); @@ -210,6 +221,7 @@ public function getProjectInfo(string $projectId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_ADMIN)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function editProject( string $projectId, ?string $name = null, ?string $contact_email = null, ?string $autoexport = null, ?string $currencyname = null, ?bool $deletion_disabled = null, @@ -238,6 +250,7 @@ public function editProject( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_ADMIN)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function deleteProject(string $projectId): DataResponse { $result = $this->projectService->deleteProject($projectId); if (!isset($result['error'])) { @@ -266,6 +279,7 @@ public function deleteProject(string $projectId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function getProjectStatistics( string $projectId, ?int $tsMin = null, ?int $tsMax = null, ?int $paymentModeId = null, ?int $categoryId = null, ?float $amountMin = null, ?float $amountMax = null, @@ -289,6 +303,7 @@ public function getProjectStatistics( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function getProjectSettlement(string $projectId, ?int $centeredOn = null, ?int $maxTimestamp = null): DataResponse { $result = $this->projectService->getProjectSettlement($projectId, $centeredOn, $maxTimestamp); return new DataResponse($result); @@ -306,6 +321,7 @@ public function getProjectSettlement(string $projectId, ?int $centeredOn = null, #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function autoSettlement(string $projectId, ?int $centeredOn = null, int $precision = 2, ?int $maxTimestamp = null): DataResponse { $result = $this->projectService->autoSettlement($projectId, $centeredOn, $precision, $maxTimestamp); if (isset($result['success'])) { @@ -327,6 +343,7 @@ public function autoSettlement(string $projectId, ?int $centeredOn = null, int $ #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Members'])] public function getMembers(string $projectId, ?int $lastChanged = null): DataResponse { $members = $this->projectService->getMembers($projectId, null, $lastChanged); return new DataResponse($members); @@ -345,6 +362,7 @@ public function getMembers(string $projectId, ?int $lastChanged = null): DataRes #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Members'])] public function deleteMember(string $projectId, int $memberId): DataResponse { $result = $this->projectService->deleteMember($projectId, $memberId); if (isset($result['success'])) { @@ -371,6 +389,7 @@ public function deleteMember(string $projectId, int $memberId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Members'])] public function editMember( string $projectId, int $memberId, ?string $name = null, ?float $weight = null, $activated = null, ?string $color = null, ?string $userid = null @@ -408,6 +427,7 @@ public function editMember( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Members'])] public function createMember( string $projectId, string $name, ?string $userid = null, float $weight = 1, int $active = 1, ?string $color = null @@ -448,6 +468,7 @@ public function createMember( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function editBill( string $projectId, int $billId, ?string $date = null, ?string $what = null, ?int $payer = null, ?string $payed_for = null, ?float $amount = null, ?string $repeat = null, @@ -503,6 +524,7 @@ public function editBill( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function editBills( string $projectId, array $billIds, ?int $categoryid = null, ?string $date = null, ?string $what = null, ?int $payer = null, ?string $payed_for = null, @@ -549,6 +571,7 @@ public function editBills( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function moveBill(string $projectId, int $billId, string $toProjectId): DataResponse { $userAccessLevel = $this->projectService->getUserMaxAccessLevel($this->userId, $toProjectId); if ($userAccessLevel < Application::ACCESS_LEVEL_PARTICIPANT) { @@ -592,6 +615,7 @@ public function moveBill(string $projectId, int $billId, string $toProjectId): D #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function repeatBill(string $projectId, int $billId): DataResponse { $result = $this->projectService->cronRepeatBills($billId); return new DataResponse($result); @@ -624,6 +648,7 @@ public function repeatBill(string $projectId, int $billId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function createBill( string $projectId, ?string $date = null, ?string $what = null, ?int $payer = null, ?string $payed_for = null, ?float $amount = null, ?string $repeat = null, ?string $paymentmode = null, ?int $paymentmodeid = null, @@ -659,6 +684,7 @@ public function createBill( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function clearTrashbin(string $projectId): DataResponse { try { $this->billMapper->deleteDeletedBills($projectId); @@ -683,6 +709,7 @@ public function clearTrashbin(string $projectId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function deleteBill(string $projectId, int $billId, bool $moveToTrash = true): DataResponse { $billObj = null; if ($this->billMapper->getBill($projectId, $billId) !== null) { @@ -719,6 +746,7 @@ public function deleteBill(string $projectId, int $billId, bool $moveToTrash = t #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function deleteBills(string $projectId, array $billIds, bool $moveToTrash = true): DataResponse { foreach ($billIds as $billid) { $billObj = null; @@ -763,6 +791,7 @@ public function deleteBills(string $projectId, array $billIds, bool $moveToTrash #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function getBills( string $projectId, ?int $lastchanged = null, ?int $offset = 0, ?int $limit = null, bool $reverse = false, ?int $payerId = null, ?int $categoryId = null, ?int $paymentModeId = null, ?int $includeBillId = null, @@ -801,6 +830,7 @@ public function getBills( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Bills'])] public function getBill(string $projectId, int $billId): DataResponse { $dbBillArray = $this->billMapper->getBill($projectId, $billId); if ($dbBillArray === null) { @@ -825,6 +855,7 @@ public function getBill(string $projectId, int $billId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function editSharedAccessLevel(string $projectId, int $shId, int $accessLevel): DataResponse { $userAccessLevel = $this->projectService->getUserMaxAccessLevel($this->userId, $projectId); $shareAccessLevel = $this->projectService->getShareAccessLevel($projectId, $shId); @@ -862,6 +893,7 @@ public function editSharedAccessLevel(string $projectId, int $shId, int $accessL #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function editSharedAccess(string $projectId, int $shId, ?string $label = null, ?string $password = null): DataResponse { $userAccessLevel = $this->projectService->getUserMaxAccessLevel($this->userId, $projectId); $shareAccessLevel = $this->projectService->getShareAccessLevel($projectId, $shId); @@ -895,6 +927,7 @@ public function editSharedAccess(string $projectId, int $shId, ?string $label = #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])] public function createPaymentMode(string $projectId, string $name, ?string $icon, string $color, ?int $order = 0): DataResponse { $result = $this->projectService->createPaymentMode($projectId, $name, $icon, $color, $order); return new DataResponse($result); @@ -916,6 +949,7 @@ public function createPaymentMode(string $projectId, string $name, ?string $icon #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])] public function editPaymentMode( string $projectId, int $pmId, ?string $name = null, ?string $icon = null, ?string $color = null ): DataResponse { @@ -930,7 +964,7 @@ public function editPaymentMode( * Save payment modes order * * @param string $projectId - * @param array $order + * @param array $order Array of objects, each object contains the order number and the payment mode ID * @return DataResponse|DataResponse * * 200: The payment mode order was successfully saved @@ -939,6 +973,7 @@ public function editPaymentMode( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])] public function savePaymentModeOrder(string $projectId, array $order): DataResponse { if ($this->projectService->savePaymentModeOrder($projectId, $order)) { return new DataResponse(true); @@ -960,6 +995,7 @@ public function savePaymentModeOrder(string $projectId, array $order): DataRespo #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Payment modes'])] public function deletePaymentMode(string $projectId, int $pmId): DataResponse { $result = $this->projectService->deletePaymentMode($projectId, $pmId); if (isset($result['success'])) { @@ -984,6 +1020,7 @@ public function deletePaymentMode(string $projectId, int $pmId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Categories'])] public function createCategory(string $projectId, string $name, ?string $icon, string $color, ?int $order = 0): DataResponse { $result = $this->projectService->createCategory($projectId, $name, $icon, $color, $order); return new DataResponse($result); @@ -1006,6 +1043,7 @@ public function createCategory(string $projectId, string $name, ?string $icon, s #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Categories'])] public function editCategory( string $projectId, int $categoryId, ?string $name = null, ?string $icon = null, ?string $color = null ): DataResponse { @@ -1031,6 +1069,7 @@ public function editCategory( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Categories'])] public function saveCategoryOrder(string $projectId, array $order): DataResponse { if ($this->projectService->saveCategoryOrder($projectId, $order)) { return new DataResponse(true); @@ -1052,6 +1091,7 @@ public function saveCategoryOrder(string $projectId, array $order): DataResponse #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Categories'])] public function deleteCategory(string $projectId, int $categoryId): DataResponse { $result = $this->projectService->deleteCategory($projectId, $categoryId); if (isset($result['success'])) { @@ -1075,6 +1115,7 @@ public function deleteCategory(string $projectId, int $categoryId): DataResponse #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Currencies'])] public function createCurrency(string $projectId, string $name, float $rate): DataResponse { $result = $this->projectService->createCurrency($projectId, $name, $rate); return new DataResponse($result); @@ -1096,6 +1137,7 @@ public function createCurrency(string $projectId, string $name, float $rate): Da #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Currencies'])] public function editCurrency(string $projectId, int $currencyId, string $name, float $rate): DataResponse { $result = $this->projectService->editCurrency($projectId, $currencyId, $name, $rate); if (!isset($result['message'])) { @@ -1118,6 +1160,7 @@ public function editCurrency(string $projectId, int $currencyId, string $name, f #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Currencies'])] public function deleteCurrency(string $projectId, int $currencyId): DataResponse { $result = $this->projectService->deleteCurrency($projectId, $currencyId); if (isset($result['success'])) { @@ -1142,6 +1185,7 @@ public function deleteCurrency(string $projectId, int $currencyId): DataResponse #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function createUserShare( string $projectId, string $userId, int $accessLevel = Application::ACCESS_LEVEL_PARTICIPANT, bool $manuallyAdded = true @@ -1167,6 +1211,7 @@ public function createUserShare( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function deleteUserShare(string $projectId, int $shId): DataResponse { // allow to delete share if user perms are at least participant AND if this share perms are <= user perms $userAccessLevel = $this->projectService->getUserMaxAccessLevel($this->userId, $projectId); @@ -1201,6 +1246,7 @@ public function deleteUserShare(string $projectId, int $shId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function createPublicShare( string $projectId, ?string $label = null, ?string $password = null, int $accesslevel = Application::ACCESS_LEVEL_PARTICIPANT ): DataResponse { @@ -1222,6 +1268,7 @@ public function createPublicShare( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function deletePublicShare(string $projectId, int $shId): DataResponse { $userAccessLevel = $this->projectService->getUserMaxAccessLevel($this->userId, $projectId); $shareAccessLevel = $this->projectService->getShareAccessLevel($projectId, $shId); @@ -1254,6 +1301,7 @@ public function deletePublicShare(string $projectId, int $shId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function createGroupShare(string $projectId, string $groupId, int $accesslevel = Application::ACCESS_LEVEL_PARTICIPANT): DataResponse { $result = $this->projectService->createGroupShare($projectId, $groupId, $this->userId, $accesslevel); if (!isset($result['message'])) { @@ -1276,6 +1324,7 @@ public function createGroupShare(string $projectId, string $groupId, int $access #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function deleteGroupShare(string $projectId, int $shId): DataResponse { // allow to delete share if user perms are at least participant AND if this share perms are <= user perms $userAccessLevel = $this->projectService->getUserMaxAccessLevel($this->userId, $projectId); @@ -1311,6 +1360,7 @@ public function deleteGroupShare(string $projectId, int $shId): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function createCircleShare(string $projectId, string $circleId, int $accesslevel = Application::ACCESS_LEVEL_PARTICIPANT): DataResponse { $result = $this->projectService->createCircleShare($projectId, $circleId, $this->userId, $accesslevel); if (!isset($result['message'])) { @@ -1333,6 +1383,7 @@ public function createCircleShare(string $projectId, string $circleId, int $acce #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function deleteCircleShare(string $projectId, int $shId): DataResponse { // allow to delete share if user perms are at least participant AND if this share perms are <= user perms $userAccessLevel = $this->projectService->getUserMaxAccessLevel($this->userId, $projectId); @@ -1363,6 +1414,7 @@ public function deleteCircleShare(string $projectId, int $shId): DataResponse { */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Sharing'])] public function getPublicFileShare(string $path): DataResponse { $cleanPath = str_replace(array('../', '..\\'), '', $path); $userFolder = $this->root->getUserFolder($this->userId); @@ -1411,6 +1463,7 @@ public function getPublicFileShare(string $path): DataResponse { #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function exportCsvSettlement(string $projectId, ?int $centeredOn = null, ?int $maxTimestamp = null): DataResponse { $result = $this->projectService->exportCsvSettlement($projectId, $this->userId, $centeredOn, $maxTimestamp); if (isset($result['path'])) { @@ -1440,6 +1493,7 @@ public function exportCsvSettlement(string $projectId, ?int $centeredOn = null, #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function exportCsvStatistics( string $projectId, ?int $tsMin = null, ?int $tsMax = null, ?int $paymentModeId = null, ?int $category = null, @@ -1470,6 +1524,7 @@ public function exportCsvStatistics( #[NoAdminRequired] #[CORS] #[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_VIEWER)] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function exportCsvProject(string $projectId, ?string $name = null): DataResponse { $result = $this->projectService->exportCsvProject($projectId, $this->userId, $name); if (isset($result['path'])) { @@ -1491,6 +1546,7 @@ public function exportCsvProject(string $projectId, ?string $name = null): DataR */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function importCsvProject(string $path): DataResponse { $result = $this->projectService->importCsvProject($path, $this->userId); if (isset($result['project_id'])) { @@ -1513,6 +1569,7 @@ public function importCsvProject(string $path): DataResponse { */ #[NoAdminRequired] #[CORS] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])] public function importSWProject(string $path): DataResponse { $result = $this->projectService->importSWProject($path, $this->userId); if (isset($result['project_id'])) { @@ -1524,6 +1581,8 @@ public function importSWProject(string $path): DataResponse { } /** + * Ping + * * Used by MoneyBuster to check if weblogin is valid * @return DataResponse, array{}> */ diff --git a/openapi.json b/openapi.json new file mode 100644 index 000000000..fa418ae84 --- /dev/null +++ b/openapi.json @@ -0,0 +1,8286 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "cospend", + "version": "0.0.1", + "description": " ", + "license": { + "name": "agpl" + } + }, + "components": { + "securitySchemes": { + "basic_auth": { + "type": "http", + "scheme": "basic" + }, + "bearer_auth": { + "type": "http", + "scheme": "bearer" + } + }, + "schemas": { + "AccessLevel": { + "type": "integer", + "format": "int64", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ] + }, + "BaseShare": { + "type": "object", + "required": [ + "id", + "accesslevel" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "accesslevel": { + "$ref": "#/components/schemas/AccessLevel" + } + } + }, + "Bill": { + "type": "object", + "required": [ + "id", + "amount", + "what", + "comment", + "timestamp", + "date", + "payer_id", + "owers", + "owerIds", + "repeat", + "paymentmode", + "paymentmodeid", + "categoryid", + "lastchanged", + "repeatallactive", + "repeatuntil", + "repeatfreq", + "deleted" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "amount": { + "type": "number", + "format": "float" + }, + "what": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "date": { + "type": "string" + }, + "payer_id": { + "type": "integer", + "format": "int64" + }, + "owers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Ower" + } + }, + "owerIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "repeat": { + "$ref": "#/components/schemas/Frequency" + }, + "paymentmode": { + "type": "string" + }, + "paymentmodeid": { + "type": "integer", + "format": "int64" + }, + "categoryid": { + "type": "integer", + "format": "int64" + }, + "lastchanged": { + "type": "integer", + "format": "int64" + }, + "repeatallactive": { + "type": "integer", + "format": "int64" + }, + "repeatuntil": { + "type": "string" + }, + "repeatfreq": { + "type": "integer", + "format": "int64" + }, + "deleted": { + "type": "integer", + "format": "int64" + } + } + }, + "Category": { + "$ref": "#/components/schemas/CategoryOrPaymentMode" + }, + "CategoryOrPaymentMode": { + "type": "object", + "required": [ + "id", + "projectid", + "name", + "color", + "icon", + "order" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "projectid": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "color": { + "type": "string", + "nullable": true + }, + "icon": { + "type": "string", + "nullable": true + }, + "order": { + "type": "integer", + "format": "int64" + } + } + }, + "CircleShare": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseShare" + }, + { + "type": "object", + "required": [ + "type", + "circleid", + "name" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "c" + ] + }, + "circleid": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + ] + }, + "Currency": { + "type": "object", + "required": [ + "id", + "name", + "exchange_rate", + "projectid" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "exchange_rate": { + "type": "number", + "format": "float" + }, + "projectid": { + "type": "string" + } + } + }, + "ExtraProjectInfo": { + "type": "object", + "required": [ + "active_members", + "members", + "balance", + "nb_bills", + "total_spent", + "nb_trashbin_bills", + "shares", + "currencies", + "categories", + "paymentmodes" + ], + "properties": { + "active_members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Member" + } + }, + "members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Member" + } + }, + "balance": { + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "nb_bills": { + "type": "integer", + "format": "int64" + }, + "total_spent": { + "type": "number", + "format": "float" + }, + "nb_trashbin_bills": { + "type": "integer", + "format": "int64" + }, + "shares": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Share" + } + }, + "currencies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Currency" + } + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CategoryOrPaymentMode" + } + }, + "paymentmodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CategoryOrPaymentMode" + } + } + } + }, + "Frequency": { + "type": "string", + "enum": [ + "n", + "d", + "w", + "b", + "s", + "m", + "y" + ] + }, + "FullProjectInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/ProjectInfoPlusExtra" + }, + { + "type": "object", + "required": [ + "myaccesslevel" + ], + "properties": { + "myaccesslevel": { + "type": "integer", + "format": "int64" + } + } + } + ] + }, + "GroupShare": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseShare" + }, + { + "type": "object", + "required": [ + "type", + "groupid", + "name" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "g" + ] + }, + "groupid": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + ] + }, + "Member": { + "type": "object", + "required": [ + "activated", + "userid", + "name", + "id", + "weight", + "color", + "lastchanged" + ], + "properties": { + "activated": { + "type": "boolean" + }, + "userid": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "weight": { + "type": "number", + "format": "float" + }, + "color": { + "type": "object", + "required": [ + "r", + "g", + "b" + ], + "properties": { + "r": { + "type": "integer", + "format": "int64" + }, + "g": { + "type": "integer", + "format": "int64" + }, + "b": { + "type": "integer", + "format": "int64" + } + } + }, + "lastchanged": { + "type": "integer", + "format": "int64" + } + } + }, + "OCSMeta": { + "type": "object", + "required": [ + "status", + "statuscode" + ], + "properties": { + "status": { + "type": "string" + }, + "statuscode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "totalitems": { + "type": "string" + }, + "itemsperpage": { + "type": "string" + } + } + }, + "Ower": { + "type": "object", + "required": [ + "id", + "weight", + "name", + "activated" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "weight": { + "type": "number", + "format": "float" + }, + "name": { + "type": "string" + }, + "activated": { + "type": "boolean" + } + } + }, + "PaymentMode": { + "allOf": [ + { + "$ref": "#/components/schemas/CategoryOrPaymentMode" + }, + { + "type": "object", + "required": [ + "old_id" + ], + "properties": { + "old_id": { + "type": "string" + } + } + } + ] + }, + "ProjectInfo": { + "type": "object", + "required": [ + "id", + "userid", + "name", + "email", + "autoexport", + "lastchanged", + "deletiondisabled", + "categorysort", + "paymentmodesort", + "currencyname", + "archived_ts" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "userid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string", + "nullable": true + }, + "autoexport": { + "type": "string" + }, + "lastchanged": { + "type": "integer", + "format": "int64" + }, + "deletiondisabled": { + "type": "boolean" + }, + "categorysort": { + "type": "string" + }, + "paymentmodesort": { + "type": "string" + }, + "currencyname": { + "type": "string" + }, + "archived_ts": { + "type": "integer", + "format": "int64" + } + } + }, + "ProjectInfoPlusExtra": { + "allOf": [ + { + "$ref": "#/components/schemas/ProjectInfo" + }, + { + "$ref": "#/components/schemas/ExtraProjectInfo" + } + ] + }, + "PublicCapabilities": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ] + } + } + }, + "PublicShare": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseShare" + }, + { + "type": "object", + "required": [ + "type", + "token", + "label", + "password" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "l" + ] + }, + "token": { + "type": "string" + }, + "label": { + "type": "string", + "nullable": true + }, + "password": { + "type": "string", + "nullable": true + } + } + } + ] + }, + "Share": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserShare" + }, + { + "$ref": "#/components/schemas/GroupShare" + }, + { + "$ref": "#/components/schemas/CircleShare" + }, + { + "$ref": "#/components/schemas/PublicShare" + } + ] + } + }, + "UserShare": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseShare" + }, + { + "type": "object", + "required": [ + "type", + "userid", + "name", + "manually_added" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "u" + ] + }, + "userid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "manually_added": { + "type": "boolean" + } + } + } + ] + } + } + }, + "paths": { + "/ocs/v2.php/apps/cospend/api/{apiVersion}/option-values": { + "get": { + "operationId": "settings-get-options-values", + "summary": "Get setting values", + "description": "Get setting values from the database for the current user", + "tags": [ + "Settings" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "settings-save-option-values", + "summary": "Save setting values", + "description": "Save setting values to the database for the current user", + "tags": [ + "Settings" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "options[]", + "in": "query", + "description": "Array of setting key/values to save", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/ping": { + "get": { + "operationId": "api-ping", + "summary": "Ping", + "description": "Used by MoneyBuster to check if weblogin is valid", + "tags": [ + "api" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "string", + "nullable": true + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects": { + "get": { + "operationId": "projects-get-projects", + "summary": "Get project list", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Project list", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FullProjectInfo" + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "projects-create-project", + "summary": "Create a project", + "description": "Change for clients: response now contains full project info", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "contact_email", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Project successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/FullProjectInfo" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to create project", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}": { + "delete": { + "operationId": "projects-delete-project", + "summary": "Delete a project", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The project was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "The project was not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "put": { + "operationId": "projects-edit-project", + "summary": "Edit a project", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "contact_email", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "autoexport", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "currencyname", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "deletion_disabled", + "in": "query", + "schema": { + "type": "integer", + "nullable": true, + "default": 0, + "enum": [ + 0, + 1 + ] + } + }, + { + "name": "categorysort", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "paymentmodesort", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "archived_ts", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The project was successfully update", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string", + "enum": [ + "UPDATED" + ] + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the project", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "get": { + "operationId": "projects-get-project-info", + "summary": "Get project information", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Project info", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/FullProjectInfo" + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/export-csv-project": { + "get": { + "operationId": "projects-export-csv-project", + "summary": "Get CSV project export", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/import-csv-project": { + "get": { + "operationId": "projects-import-csv-project", + "summary": "Import a project from a CSV file", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "path", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/FullProjectInfo" + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/import-sw-project": { + "get": { + "operationId": "projects-importsw-project", + "summary": "Import a SplitWise project from a CSV file", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "path", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/FullProjectInfo" + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/statistics": { + "get": { + "operationId": "projects-get-project-statistics", + "summary": "Get project statistics", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "tsMin", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "tsMax", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "paymentModeId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "categoryId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "amountMin", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "amountMax", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "showDisabled", + "in": "query", + "schema": { + "type": "string", + "default": "1" + } + }, + { + "name": "currencyId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "payerId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/export-csv-statistics": { + "get": { + "operationId": "projects-export-csv-statistics", + "summary": "Get CSV statistics", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "tsMin", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "tsMax", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "paymentModeId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "category", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "amountMin", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "amountMax", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "showDisabled", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + } + }, + { + "name": "currencyId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/settlement": { + "get": { + "operationId": "projects-get-project-settlement", + "summary": "Get project settlement info", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "centeredOn", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "maxTimestamp", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "transactions", + "balances" + ], + "properties": { + "transactions": { + "type": "array", + "nullable": true, + "items": { + "type": "object", + "required": [ + "to", + "amount", + "from" + ], + "properties": { + "to": { + "type": "integer", + "format": "int64" + }, + "amount": { + "type": "number", + "format": "float" + }, + "from": { + "type": "integer", + "format": "int64" + } + } + } + }, + "balances": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "float" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/auto-settlement": { + "get": { + "operationId": "projects-auto-settlement", + "summary": "Get automatic settlement plan", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "centeredOn", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "precision", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "default": 2 + } + }, + { + "name": "maxTimestamp", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/export-csv-settlement": { + "get": { + "operationId": "projects-export-csv-settlement", + "summary": "Get CSV settlement plan", + "tags": [ + "Projects" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "centeredOn", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "maxTimestamp", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/public-file-share": { + "post": { + "operationId": "sharing-get-public-file-share", + "summary": "Get a public file share from a node path", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "path", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/bills": { + "post": { + "operationId": "bills-create-bill", + "summary": "Create a bill", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "date", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "what", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "payer", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "payed_for", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "amount", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "repeat", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "paymentmode", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "paymentmodeid", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "categoryid", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "repeatallactive", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + }, + { + "name": "repeatuntil", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "timestamp", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "comment", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "repeatfreq", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The bill was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to create the bill", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "get": { + "operationId": "bills-get-bills", + "summary": "Get a project's bill list", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "lastchanged", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": 0 + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "reverse", + "in": "query", + "schema": { + "type": "integer", + "default": 0, + "enum": [ + 0, + 1 + ] + } + }, + { + "name": "payerId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "categoryId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "paymentModeId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "includeBillId", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "searchTerm", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "deleted", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": 0 + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The bill list was successfully obtained", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "nb_bills", + "allBillIds", + "timestamp", + "bills" + ], + "properties": { + "nb_bills": { + "type": "integer", + "format": "int64" + }, + "allBillIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "timestamp": { + "type": "integer", + "format": "int64" + }, + "bills": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Bill" + } + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "operationId": "bills-delete-bills", + "summary": "Delete multiple bills", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "billIds[]", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + { + "name": "moveToTrash", + "in": "query", + "schema": { + "type": "integer", + "default": 1, + "enum": [ + 0, + 1 + ] + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Bills were successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "operationId": "bills-edit-bills", + "summary": "Edit multiple bills", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "billIds[]", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + { + "name": "categoryid", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "date", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "what", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "payer", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "payed_for", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "amount", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "repeat", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "paymentmode", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "paymentmodeid", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "repeatallactive", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "repeatuntil", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "timestamp", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "comment", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "repeatfreq", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "deleted", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The bills were successfully edited", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the bills", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/bills/{billId}": { + "get": { + "operationId": "bills-get-bill", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "billId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The bill was successfully obtained", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/Bill" + } + } + } + } + } + } + } + }, + "404": { + "description": "The bill was not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "bills-delete-bill", + "summary": "Delete a bill", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "moveToTrash", + "in": "query", + "schema": { + "type": "integer", + "default": 1, + "enum": [ + 0, + 1 + ] + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "billId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Bill was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } + } + } + }, + "403": { + "description": "This action is forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "put": { + "operationId": "bills-edit-bill", + "summary": "Edit a bill", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "date", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "what", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "payer", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "payed_for", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "amount", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "repeat", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "paymentmode", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "paymentmodeid", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "categoryid", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "repeatallactive", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "repeatuntil", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "timestamp", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "comment", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "repeatfreq", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "deleted", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "billId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The bill was successfully edited", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the bill", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/trashbin": { + "delete": { + "operationId": "bills-clear-trashbin", + "summary": "Clear the trashbin", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The trashbin was successfully cleared", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to clear the trashbin", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/bills/{billId}/move": { + "post": { + "operationId": "bills-move-bill", + "summary": "Move a bill from one project to another", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "toProjectId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "billId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The bill was moved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to move the bill", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Current user is not allowed to create a bill in the target project", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/bills/{billId}/repeat": { + "get": { + "operationId": "bills-repeat-bill", + "summary": "Trigger bill repetition for a specific bill", + "tags": [ + "Bills" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "billId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "required": [ + "new_bill_id", + "date_orig", + "date_repeat", + "what", + "project_name" + ], + "properties": { + "new_bill_id": { + "type": "integer", + "format": "int64" + }, + "date_orig": { + "type": "string" + }, + "date_repeat": { + "type": "string" + }, + "what": { + "type": "string" + }, + "project_name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/members": { + "get": { + "operationId": "members-get-members", + "summary": "Get a project's member list", + "tags": [ + "Members" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "lastChanged", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "List of members", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Member" + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "members-create-member", + "summary": "Create a project member", + "tags": [ + "Members" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userid", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "weight", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "default": 1 + } + }, + { + "name": "active", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + } + }, + { + "name": "color", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The member was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/Member" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to create the member", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/members/{memberId}": { + "put": { + "operationId": "members-edit-member", + "summary": "Edit a project member", + "tags": [ + "Members" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "weight", + "in": "query", + "schema": { + "type": "number", + "format": "float", + "nullable": true + } + }, + { + "name": "activated", + "in": "query", + "schema": { + "nullable": true + } + }, + { + "name": "color", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "userid", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "memberId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Member was successfully edited (and deleted if it was disabled and wasn't ower of any bill)", + "content": { + "application/json": { + "schema": [ + { + "oneOf": [ + { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "nullable": true + } + } + } + } + }, + { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/Member" + } + } + } + } + } + ] + } + ] + } + } + }, + "400": { + "description": "Failed to edit the member", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "members-delete-member", + "summary": "Delete or disable a member", + "tags": [ + "Members" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "memberId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Member was successfully disabled or deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } + } + } + }, + "404": { + "description": "Member does not exist", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/user-share": { + "post": { + "operationId": "sharing-create-user-share", + "summary": "Create a user share", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "userId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "accessLevel", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "manuallyAdded", + "in": "query", + "schema": { + "type": "integer", + "default": 1, + "enum": [ + 0, + 1 + ] + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The user share was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UserShare" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to create the user share", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/user-share/{shId}": { + "delete": { + "operationId": "sharing-delete-user-share", + "summary": "Delete a user share", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "shId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The user share was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to delete the user share", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/group-share": { + "post": { + "operationId": "sharing-create-group-share", + "summary": "Create a group share", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "groupId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "accesslevel", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The group share was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/GroupShare" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to create the group share", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/group-share/{shId}": { + "delete": { + "operationId": "sharing-delete-group-share", + "summary": "Delete a group share", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "shId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The group share was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to delete the group share", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/circle-share": { + "post": { + "operationId": "sharing-create-circle-share", + "summary": "Create a circle share", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "circleId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "accesslevel", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The circle share was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/CircleShare" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to create the circle share", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/circle-share/{shId}": { + "delete": { + "operationId": "sharing-delete-circle-share", + "summary": "Delete a circle share", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "shId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The circle share was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to delete the circle share", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/public-share": { + "post": { + "operationId": "sharing-create-public-share", + "summary": "Create a public share link", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "label", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "password", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "accesslevel", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The public share was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/PublicShare" + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/public-share/{shId}": { + "delete": { + "operationId": "sharing-delete-public-share", + "summary": "Delete a public share link", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "shId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The public share was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to delete the public share", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/share-access-level/{shId}": { + "put": { + "operationId": "sharing-edit-shared-access-level", + "summary": "Edit a shared access level", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "accessLevel", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "shId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The shared access level was successfully edited", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the access level", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "The current user cannot set this access level", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/share-access/{shId}": { + "put": { + "operationId": "sharing-edit-shared-access", + "summary": "Edit a shared access", + "tags": [ + "Sharing" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "label", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "password", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "shId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The shared access was successfully edited", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string", + "enum": [ + "OK" + ] + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the access level", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "The current user is not allowed to edit this shared access", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/currency": { + "post": { + "operationId": "currencies-create-currency", + "summary": "Create a currency", + "tags": [ + "Currencies" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rate", + "in": "query", + "required": true, + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The currency was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/currency/{currencyId}": { + "put": { + "operationId": "currencies-edit-currency", + "summary": "Edit a currency", + "tags": [ + "Currencies" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rate", + "in": "query", + "required": true, + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "currencyId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The currency was successfully edited", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/Currency" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the currency", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "operationId": "currencies-delete-currency", + "summary": "Delete a currency", + "tags": [ + "Currencies" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "currencyId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The currency was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to delete the currency", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/paymentmode": { + "post": { + "operationId": "payment modes-create-payment-mode", + "summary": "Create a payment mode", + "tags": [ + "Payment modes" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "icon", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "color", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": 0 + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Payment mode was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/paymentmode/{pmId}": { + "put": { + "operationId": "payment modes-edit-payment-mode", + "summary": "Edit a payment mode", + "tags": [ + "Payment modes" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "icon", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "color", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pmId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The payment mode was successfully edited", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/PaymentMode" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the payment mode", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "payment modes-delete-payment-mode", + "summary": "Delete a payment mode", + "tags": [ + "Payment modes" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pmId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The payment mode was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to delete the payment mode", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/paymentmode-order": { + "put": { + "operationId": "payment modes-save-payment-mode-order", + "summary": "Save payment modes order", + "tags": [ + "Payment modes" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "order[]", + "in": "query", + "description": "Array of objects, each object contains the order number and the payment mode ID", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object", + "required": [ + "order", + "id" + ], + "properties": { + "order": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "integer", + "format": "int64" + } + } + } + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The payment mode order was successfully saved", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "boolean", + "enum": [ + true + ] + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to save the payment mode order", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "boolean", + "enum": [ + false + ] + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/category": { + "post": { + "operationId": "categories-create-category", + "summary": "Create a category", + "tags": [ + "Categories" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "icon", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "color", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "nullable": true, + "default": 0 + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The category was successfully created", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/category/{categoryId}": { + "put": { + "operationId": "categories-edit-category", + "summary": "Edit a category", + "tags": [ + "Categories" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "icon", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "color", + "in": "query", + "schema": { + "type": "string", + "nullable": true + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "categoryId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The category was successfully edited", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/Category" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to edit the category", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "delete": { + "operationId": "categories-delete-category", + "summary": "Delete a category", + "tags": [ + "Categories" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "categoryId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The category was successfully deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to delete the category", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/cospend/api/{apiVersion}/projects/{projectId}/category-order": { + "put": { + "operationId": "categories-save-category-order", + "summary": "Save categories order", + "tags": [ + "Categories" + ], + "security": [ + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "order[]", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object", + "required": [ + "order", + "id" + ], + "properties": { + "order": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "integer", + "format": "int64" + } + } + } + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v1" + ], + "default": "v1" + } + }, + { + "name": "projectId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "The category order was successfully saved", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "boolean", + "enum": [ + true + ] + } + } + } + } + } + } + } + }, + "400": { + "description": "Failed to save the category order", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "boolean", + "enum": [ + false + ] + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "tags": [] +} \ No newline at end of file