API Access to Attachments/Images

1. What is the issue? Please be detailed.

I've followed the API guide and had great success in obtaining and using a token to access submission data using Jasper Studio in both main and subreports but I'm a little confused of what's needed when trying to access attachments; specifically images.

Can I supply a bearer token in the header of the GET request to access the image, just like any other field? If so, great - I just need to work out how to do it with Jasper. If not, how are folks here embedding images in reports? Are you at all?

Under the OData section on the API documentation it refers to a browser cookie, which won't be present if I use Jasper Server to connect to Central.

I only learned what a token, GET request and header are this week so I'm pretty new to all this. Getting images from ODK into my Jasper report is the last hurdle!

2. What steps can we take to reproduce this issue?

N/A

3. What have you tried to fix the issue?

Nothing yet - looking for tips to get me on the right track.

4. Upload any test forms or screenshots below.

N/A

Thanks!

I think I may have found the answer on GitHub (closed issue 43, https://github.com/getodk/central/issues/43) - it looks like the token will work to access the images which is great!

Don't suppose anyone's managed to pull this off using Jasper? Will post over there but similar questions have been asked before and doesn't seem to get any answers - it seems their image element doesn't have the option to do a GET request with a header.

Thanks!