View | Details | Raw Unified | Return to bug 29810
Collapse All | Expand All

(-)a/api/v1/swagger/swagger.yaml (-4 / +18 lines)
Lines 448-454 info: Link Here
448
    level will result in an "AND" query, whilst combinding them in an `ARRAY` wilth result in an
448
    level will result in an "AND" query, whilst combinding them in an `ARRAY` wilth result in an
449
    "OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those
449
    "OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those
450
    results with both field1 containing value2 AND field2 containing value2 for example.
450
    results with both field1 containing value2 AND field2 containing value2 for example.
451
    
451
452
    Additionally, if you are requesting related data be embedded into the response one can query
453
    on the related data using dot notation in the field names.
454
452
    ### Examples
455
    ### Examples
453
    
456
    
454
    The following request would return any patron with firstname "Henry" and lastname "Acevedo";
457
    The following request would return any patron with firstname "Henry" and lastname "Acevedo";
Lines 459-470 info: Link Here
459
    
462
    
460
    `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": { "-like": "Ace%" }"`
463
    `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": { "-like": "Ace%" }"`
461
    
464
    
462
    The following request would return any patron whilse lastname is "Acevedo" OR "Bernardo"
465
    The following request would return any patron whose lastname is "Acevedo" OR "Bernardo"
463
    
466
    
464
    `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": [ "Acevedo", "Bernardo" ] }"`
467
    `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": [ "Acevedo", "Bernardo" ] }"`
465
    
468
    
469
    The following request embeds the related patron extended attributes data and filters on it.
470
471
    `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" }'`
472
466
    ## Special headers
473
    ## Special headers
467
    
474
475
    ### x-koha-embed
476
477
    This optional header allows the api consumer to request additional related data
478
    to be returned in the api response.  It also allows for cross referencing in the
479
    queries as described above. It accepts a comma delimited list of relation names.
480
481
    Relations may on occasion also support dot delimited nesting to allow traversal.
482
468
    ### x-koha-library
483
    ### x-koha-library
469
    
484
    
470
    This optional header should be passed to give your api request a library
485
    This optional header should be passed to give your api request a library
471
- 

Return to bug 29810