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

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

Return to bug 29810