Bug 28473 - Add REST endpoint for searching extended patron attributes
Summary: Add REST endpoint for searching extended patron attributes
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-27 12:52 UTC by Joonas Kylmälä
Modified: 2022-10-19 07:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joonas Kylmälä 2021-05-27 12:52:48 UTC
We would like to be able to search all our extended patron attributes in the database. The following endpoint would probably need to be added for this:

GET /extended_attributes

It should have an option to search with the attribute type and value.

This is API endpoint would be useful for example gathering a list of patrons with a specific extended attribute which has a statistics group for example, or for searching patrons that are blocked via a special attribute, and so on.
Comment 1 Tomás Cohen Arazi (tcohen) 2021-05-27 13:30:33 UTC
It is a good idea.

Remember there's the possibility to search patrons with x-koha-embed: extended_attributes, and then filter by extended_attributes.type using the q= parameter
Comment 2 Joonas Kylmälä 2021-05-28 07:18:20 UTC
(In reply to Tomás Cohen Arazi from comment #1)
> It is a good idea.
> 
> Remember there's the possibility to search patrons with x-koha-embed:
> extended_attributes, and then filter by extended_attributes.type using the
> q= parameter

That's sounds promising, thanks for the tip! I forwarded the infos to the libraries wanting to use this sort of API functionality :)
Comment 3 Tomás Cohen Arazi (tcohen) 2021-05-28 11:33:50 UTC
(In reply to Joonas Kylmälä from comment #2)
> (In reply to Tomás Cohen Arazi from comment #1)
> > It is a good idea.
> > 
> > Remember there's the possibility to search patrons with x-koha-embed:
> > extended_attributes, and then filter by extended_attributes.type using the
> > q= parameter
> 
> That's sounds promising, thanks for the tip! I forwarded the infos to the
> libraries wanting to use this sort of API functionality :)

I'm sorry, it seems we forgot to add something to the spec for that to work. My fault!

See bug 28480.
Comment 4 Jonathan Druart 2022-02-10 14:30:21 UTC
(In reply to Tomás Cohen Arazi from comment #1)
> It is a good idea.
> 
> Remember there's the possibility to search patrons with x-koha-embed:
> extended_attributes, and then filter by extended_attributes.type using the
> q= parameter

It's not working, you will need bug 30074.
Comment 5 Katrin Fischer 2022-10-19 07:24:13 UTC
I see there is an x-koha-embed for patron_attributes, probably since the switch of the patron search. Maybe this helps?