coffeepenbit / bookstack

A Python wrapper for BookStack's API
MIT License
23 stars 8 forks source link

Unable to retrieve more than 100 records with LIST methods #8

Closed Eumi1408 closed 9 months ago

Eumi1408 commented 1 year ago

Our wiki has 100+ pages. The list methods of this framework only return up to 100 records at a time. We have tried including offset, count, and filter as keyword arguments in several different ways but no luck. Is it possible to include these parameters when calling the list methods? If yes, could you let us know how?

dirks commented 1 year ago

offset, count, sort and filter are all query parameters of the API Endpoint URL, see https://demo.bookstackapp.com/api/docs#listing-endpoints

The api methods are all generated dynamically by reading the URL path api/docs.json/ of the given base url and those query parameters are no part of this. A co worker and I solved this by expanding the url with the query string if the keyword query is given in the api request, see https://github.com/coffeepenbit/bookstack/compare/master...dirks:bookstack:feature/query


The code in this repo after 0.1.0-beta brakes/changes behaviour for GET requests which need an id. Basically one is supposed to add one json dict as argument, so instead of

api.get_pages_read(id = 143)

use

api.get_pages_read({'id':'143'})

Not sure yet if I will rewrite our query expansion on top of this or just keep my fork on top of the released beta. We would need to rewrite other code that depends on that.