Retrieval of Analysis Reports from a given Sample by using the JSON API

I need a method to access the children objects of the Analysis Request, which is the one containing the analysis report object, I can only see the children objects if I add children=yes to the API call . Is there any shortcut in which I can acquire the Analysis Report pdf download link(or api url) of a certain Analysis Request?

Screenshot from 2020-05-08 13-58-03

Having the ID of the sample you can directly search for ARReport portal_type with complete=1 and pick the url for the Pdf download directly from there:

http://localhost:9090/senaite/@@API/senaite/v1/search?portal_type=ARReport&parent_id=PL-0001&complete=1

Where PL-0001 corresponds to the Sample ID the Report belongs to. Note the Pdf field with the download url.

If you don’t have the sample ID, but the sample UID, you can use parent_uid param instead of parent_id:
http://localhost:9090/senaite/@@API/senaite/v1/search?portal_type=ARReport&parent_uid=15a9f821d92b44f48a3e55d76bf02794&complete=1

Thank you for your reply @xispa. I tried with the same URL you provided but I am getting all the analysis reports instead, not only the one with the desired parent_id


You can see that I used H2O-0016 in the URL but I received all the reports instead

Thanks for your feedback @Omar012 . Would you mind to open an issue in https://github.com/senaite/senaite.jsonapi so we can look at this in more detail?

sure thing, thank you

any update on this feature. i think it still persists with the most up-to-date jsonapi