API paging, userid patron query
Hi collective wisdom, Are there secret paging parameters for the Koha REST API? I don't see any in the documentation. Specifically, I'm using the list patrons route like /api/v1/patrons?userid={query} but I have a username that is short and a subset of many other usernames. The API returns 12 results and the user account, which I can see exists, is not included amongst them. I'm wondering if I need to page through more results, but blind guessing of parameters like "page", "offset", and "start" only leads to "malformed query string" errors. Best, ERIC PHETTEPLACE Systems Librarian, Libraries (he/him) ephetteplace@cca.edu *CCA is situated on the traditional unceded lands of the **Chochenyo and Ramaytush Ohlone** peoples.* Black-owned bookstores in Oakland: Ashay by the Bay <https://ashaybythebay.com/>, Marcus Books <https://www.facebook.com/marcus.books/> :(){ :|: & };:
Don't know Koha API but might there be a hard limit like for the reports? maybe "limit"... Regards, |----------------------------------------------------------------------------------------| Stay safe / Cuídate/ Reste sécurisé *7* Switch off as you go / Apaga lo que no usas / Débranchez au fur et à mesure. *q *Recycle always / Recicla siempre / Recyclez toujours P Print only if absolutely necessary / Imprime solo si es necesario / Imprimez seulement si nécessaire Le mer. 30 août 2023 à 14:18, Eric Phetteplace <ephetteplace@cca.edu> a écrit :
Hi collective wisdom,
Are there secret paging parameters for the Koha REST API? I don't see any in the documentation.
Specifically, I'm using the list patrons route like /api/v1/patrons?userid={query} but I have a username that is short and a subset of many other usernames. The API returns 12 results and the user account, which I can see exists, is not included amongst them. I'm wondering if I need to page through more results, but blind guessing of parameters like "page", "offset", and "start" only leads to "malformed query string" errors.
Best,
ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)
ephetteplace@cca.edu
*CCA is situated on the traditional unceded lands of the **Chochenyo and Ramaytush Ohlone** peoples.*
Black-owned bookstores in Oakland: Ashay by the Bay <https://ashaybythebay.com/>, Marcus Books <https://www.facebook.com/marcus.books/>
:(){ :|: & };: _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Eric, Have you checked your RESTdefaultPageSize system preference? On Wed, Aug 30, 2023 at 1:17 PM Eric Phetteplace <ephetteplace@cca.edu> wrote:
Hi collective wisdom,
Are there secret paging parameters for the Koha REST API? I don't see any in the documentation.
Specifically, I'm using the list patrons route like /api/v1/patrons?userid={query} but I have a username that is short and a subset of many other usernames. The API returns 12 results and the user account, which I can see exists, is not included amongst them. I'm wondering if I need to page through more results, but blind guessing of parameters like "page", "offset", and "start" only leads to "malformed query string" errors.
Best,
ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)
ephetteplace@cca.edu
*CCA is situated on the traditional unceded lands of the **Chochenyo and Ramaytush Ohlone** peoples.*
Black-owned bookstores in Oakland: Ashay by the Bay <https://ashaybythebay.com/>, Marcus Books <https://www.facebook.com/marcus.books/>
:(){ :|: & };: _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
-- Lucas Gass Web Developer
Hi, See https://api.koha-community.org/#tag/patrons/operation/listPatrons Especially query parameters _page and _per_page. If you suspect there may be more results than 12, you can find the total number of results in response headers. X-Total-Count header containing the total results count, and X-Base-Total-Count header containing the total of the non-filtered results count. Lari Taskula CEO, Hypernova Oy PL 16 80101 Joensuu, Finland On 30.8.2023 22.16, Eric Phetteplace wrote:
Hi collective wisdom,
Are there secret paging parameters for the Koha REST API? I don't see any in the documentation.
Specifically, I'm using the list patrons route like /api/v1/patrons?userid={query} but I have a username that is short and a subset of many other usernames. The API returns 12 results and the user account, which I can see exists, is not included amongst them. I'm wondering if I need to page through more results, but blind guessing of parameters like "page", "offset", and "start" only leads to "malformed query string" errors.
Best,
ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)
ephetteplace@cca.edu
*CCA is situated on the traditional unceded lands of the **Chochenyo and Ramaytush Ohlone** peoples.*
Black-owned bookstores in Oakland: Ashay by the Bay <https://ashaybythebay.com/>, Marcus Books <https://www.facebook.com/marcus.books/>
:(){ :|: & };: _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Hi all, Ah-ha, so there were paging options! My apologies, I could have discovered these with a little more thorough research. Thanks to Lucas and Lari for their helpful replies. For my purposes, either approach works, and it did turn out to be an issue where the result I was looking for simply wasn't in the first page. Increasing the RESTdefaultPageSize option or using a higher _per_page parameter in the query string both worked. Best, ERIC PHETTEPLACE Systems Librarian, Libraries (he/him) ephetteplace@cca.edu *CCA is situated on the traditional unceded lands of the **Chochenyo and Ramaytush Ohlone** peoples.* Black-owned bookstores in Oakland: Ashay by the Bay <https://ashaybythebay.com/>, Marcus Books <https://www.facebook.com/marcus.books/> :(){ :|: & };: On Wed, Aug 30, 2023 at 1:47 PM Lari Taskula <lari.taskula@hypernova.fi> wrote:
Hi,
See https://api.koha-community.org/#tag/patrons/operation/listPatrons
Especially query parameters _page and _per_page.
If you suspect there may be more results than 12, you can find the total number of results in response headers. X-Total-Count header containing the total results count, and X-Base-Total-Count header containing the total of the non-filtered results count.
Lari Taskula CEO, Hypernova Oy PL 16 80101 Joensuu, Finland
On 30.8.2023 22.16, Eric Phetteplace wrote:
Hi collective wisdom,
Are there secret paging parameters for the Koha REST API? I don't see any in the documentation.
Specifically, I'm using the list patrons route like /api/v1/patrons?userid={query} but I have a username that is short and a subset of many other usernames. The API returns 12 results and the user account, which I can see exists, is not included amongst them. I'm wondering if I need to page through more results, but blind guessing of parameters like "page", "offset", and "start" only leads to "malformed query string" errors.
Best,
ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)
ephetteplace@cca.edu
*CCA is situated on the traditional unceded lands of the **Chochenyo and Ramaytush Ohlone** peoples.*
Black-owned bookstores in Oakland: Ashay by the Bay <https://ashaybythebay.com/>, Marcus Books <https://www.facebook.com/marcus.books/>
:(){ :|: & };: _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
participants (4)
-
Alvaro Cornejo -
Eric Phetteplace -
Lari Taskula -
Lucas Gass