Lines 463-468
info:
Link Here
|
463 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
463 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
464 |
results with both field1 containing value2 AND field2 containing value2 for example. |
464 |
results with both field1 containing value2 AND field2 containing value2 for example. |
465 |
|
465 |
|
|
|
466 |
Additionally, if you are requesting related data be embedded into the response one can query |
467 |
on the related data using dot notation in the field names. |
468 |
|
466 |
### Examples |
469 |
### Examples |
467 |
|
470 |
|
468 |
The following request would return any patron with firstname "Henry" and lastname "Acevedo"; |
471 |
The following request would return any patron with firstname "Henry" and lastname "Acevedo"; |
Lines 473-484
info:
Link Here
|
473 |
|
476 |
|
474 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": { "-like": "Ace%" }"` |
477 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": { "-like": "Ace%" }"` |
475 |
|
478 |
|
476 |
The following request would return any patron whilse lastname is "Acevedo" OR "Bernardo" |
479 |
The following request would return any patron whose lastname is "Acevedo" OR "Bernardo" |
477 |
|
480 |
|
478 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": [ "Acevedo", "Bernardo" ] }"` |
481 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": [ "Acevedo", "Bernardo" ] }"` |
479 |
|
482 |
|
|
|
483 |
The following request embeds the related patron extended attributes data and filters on it. |
484 |
|
485 |
`curl -u koha:koha =--request GET 'http://127.0.0.1:8081/api/v1/patrons/' --header 'x-koha-embed: extended_attributes' --data-raw '{ "extended_attributes.code": "internet", "extended_attributes.attribute": "1" }'` |
486 |
|
480 |
## Special headers |
487 |
## Special headers |
481 |
|
488 |
|
|
|
489 |
### x-koha-embed |
490 |
|
491 |
This optional header allows the api consumer to request additional related data |
492 |
to be returned in the api response. It also allows for cross referencing in the |
493 |
queries as described above. It accepts a comma delimited list of relation names. |
494 |
|
495 |
Relations may on occasion also support dot delimited nesting to allow traversal. |
496 |
|
482 |
### x-koha-library |
497 |
### x-koha-library |
483 |
|
498 |
|
484 |
This optional header should be passed to give your api request a library |
499 |
This optional header should be passed to give your api request a library |
485 |
- |
|
|