diff --git a/dms-api.md b/dms-api.md new file mode 100644 index 0000000..e368b72 --- /dev/null +++ b/dms-api.md @@ -0,0 +1,117 @@ +# DMS API Documentation + +## Folders + +### GET /api/dms/folder +- **Description**: Retrieves all folders/cabinets in the DMS +- **Method**: GET +- **Response**: List of all folders with their details +- **Response Example**: + ```json + { + "status": 200, + "message": "Hello from the backend", + "folders": [...] + } + ``` + +### POST /api/dms/folder +- **Description**: Creates a new folder/cabinet in the DMS +- **Method**: POST +- **Request Body**: + ```json + { + "cabinet_name": "Cabinet 1", + "cabinet_parent_id": null, + "cabinet_owner": "", + "cabinet_sector": "", + "dp_id": null, + "userID": null + } + ``` +- **Required Fields**: cabinet_name, cabinet_sector +- **Response Example**: + ```json + { + "status": 201, + "message": "Folder created successfully", + "folder": {...} + } + ``` + +### PATCH /api/dms/folder +- **Description**: Updates an existing folder (rename or move) +- **Method**: PATCH +- **Request Body**: + ```json + { + "function": "rename|move", + "cabinet_id": "folder-id", + "new_name": "New Folder Name", + "new_parent_id": "parent-folder-id" + } + ``` +- **Required Fields**: cabinet_id, function +- **Functions**: + - `rename`: Changes folder name (requires new_name) + - `move`: Changes parent folder (requires new_parent_id) +- **Response Example**: + ```json + { + "status": 200, + "message": "Folder renamed successfully", + "folder": {...} + } + ``` + +### DELETE /api/dms/folder +- **Description**: Deletes an existing folder/cabinet from the DMS +- **Method**: DELETE +- **Request Body**: + ```json + { + "cabinet_id": "folder-id" + } + ``` +- **Required Fields**: cabinet_id +- **Response Example**: + ```json + { + "status": 200, + "message": "Folder deleted successfully" + } + ``` + +## Settings + +### GET /api/dms/settings +- **Description**: Retrieves DMS configuration settings +- **Method**: GET +- **Response**: Comprehensive settings for the DMS organized by category +- **Categories**: + - User & Access Management + - Document & Folder Settings + - Metadata & Tagging + - Workflow & Automation + - Upload & Storage Settings + - System Settings + +### POST /api/dms/settings +- **Description**: Updates DMS configuration settings +- **Method**: POST +- **Request Body**: Object containing settings to update, structured by category +- **Categories**: + - access: User roles, permissions, authentication + - documents: Folder hierarchy, naming conventions, retention, version control + - metadata: Custom fields, tagging, classification + - workflow: Approval flows, notifications, automation + - upload: File types, size limits, quotas, storage + - system: Timezone, backup, maintenance, monitoring +- **Response Example**: + ```json + { + "statusCode": 200, + "message": "DMS settings updated successfully", + "data": { "settingID": 1 } + } + ``` \ No newline at end of file