API: Add endpoints for import/export
While working on my project, I extensively utilized BookStack as a central platform for organizing and managing content. During development, I identified the need for additional functionality to export and import books, along with their pages and chapters, as ZIP files. This would streamline data portability and enable seamless integration of BookStack content into other workflows. To address this requirement, I implemented the following features:
- Export functionality: Allows users to package a book, its pages, and chapters into a single ZIP file for download.
- Import functionality: Provides the ability to upload ZIP files, automatically processing the directory structure to recreate books, pages, and chapters within BookStack.
This contribution aims to enhance BookStack’s usability by improving content sharing and migration capabilities. Let me know if you'd like adjustments or additional details!
Thanks for offering this @LM-Nishant. I had planned to add ZIP import/export endpoints soon but was ideally waiting for a little more feedback regarding the use of the recently added import/export ZIP system before adding API endpoints, in case we decided to change the flow. I'd want to avoid adding any APIs which might change.
I noticed your description made no mention of the API though, do you specifically need API use? Have you been using the existing in-app ZIP imports and exports? If so, how has your experience been so far? Has everything worked okay?
@ssddanbrown I am using zip import and export, it is working fine, I have tested and then committed the code. This is not my particular need, this is common API for every user, they will export or import zip file
Thanks again @LM-Nishant. Now merged for next feature release. Testing and some other changes made in the commits which can be found in PR #5721