3 This project, written in [Rust](https://www.rust-lang.org/), will list out all pages in a BookStack instance in the following format:
7 ID=2; Name=Another Page
8 ID=3; Name=Custom Homepage page
12 Note: This is only provided as an example. The project lacks full error handling, performing non-sync blocking requests & timeouts, and was written with only beginner rust knowledge.
16 Rust, and it's tooling, is required to build this project.
17 You will also need BookStack API credentials at the ready.
19 This was built with the following versions:
21 - cargo 1.61.0 (a028ae4 2022-04-29)
22 - rustc 1.61.0 (fe5b13d68 2022-05-18)
27 # Clone down the api-scripts repo and enter this directory
28 git clone https://github.com/BookStackApp/api-scripts.git
29 cd api-scripts/rust-list-all-pages
34 # Build and run the project
36 ./target/release/rust-list-all-pages
41 You'll need to provide your API credentials for this application to find and access your BookStack instance.
42 By default, it will look for `BS_URL`, `BS_TOKEN_ID`, `BS_TOKEN_SECRET` environment variables.
43 You can expose this within your current shell environment by using something like the below:
46 export BS_URL=https://bookstack.example.com # Set to be your BookStack base URL, excluding any trailing `/api`
47 export BS_TOKEN_ID=abc123 # Set to be your API token_id
48 export BS_TOKEN_SECRET=123abc # Set to be your API token_secret
51 Alternatively, before building/running, you could edit the `src/main.rs` file and edit the values in the `ApiCredentials::from_env` function to hard-code your values.