1 # Generate Postman Collection
3 This script will scan the BookStack API documentation and generate
4 out an importable collection for [Postman](https://www.postman.com/).
6 **Note:** This has been built quite hastily so the output may not be
7 100% accurate but should massively speed up most use-cases.
9 [An example of the output can be found here](https://gist.githubusercontent.com/ssddanbrown/de805abfdf1a1defb54500055de5e7ea/raw/7ec246a4d140c98313f3bcda00e1bac6d9e68b68/bs.postman_collection.json).
11 The output collection will contain a folder for each of the API categories.
12 Collection variables are used to configure the API base url, token ID
17 You will need NodeJS installed (Tested on v16, may work on earlier versions).
21 First, download all the files in the same directory as this readme to a folder on your system
22 and run the below from within that directory.
25 # Install NodeJS dependencies via NPM
29 # ALTERNATIVELY: Open the script and add to the empty strings in the variables at the top.
30 export BS_URL=https://bookstack.example.com # Set to be your BookStack base URL
31 export BS_TOKEN_ID=abc123 # Set to be your API token_id
32 export BS_TOKEN_SECRET=123abc # Set to be your API token_secret
38 The script outputs stdout on the command line, so you'll most likely want to redirect the output to a file.
43 # Generate the collection to a 'bookstack.postman_collection.json' file.
44 node index.js > bookstack.postman_collection.json