I have try to using the enketo
/api/v2/instance/view/pdf api route in my own self instance.
My post data seems to be fine, with form_id, instance, instance_id and instance_attachments like :
'instance_attachments[<FILENAME>.jpg]': ' <FILE_URL...>.jpg', 'instance_attachments[<FILENAME>.jpg]': '<FILE_URL...>.jpg', 'instance_attachments[<FILENAME>.jpg]': '<FILE_URL...>.jpg'
If my project is shared publicly, all works find, I get the PDF with data and images.
However, if my project is not shared, enketo asks Kobocat to get attachments (without any KC token), and Kobocat throws an unauthorized message. Thus, the PDF is generated with data but without images.
My first question :
Is this normal behavior ?
If i look the log (and understand correctly), I can see that :
Enketo get the data with an internal request - It doesn’t need a token ?
My attachments FILE_URL are a “kobocat media_file url” like :
My second question :
Am I wrong in the URL of my attachments? Is there a way to get an ‘internal’ url for Enketo ?
Or maybe I’m not using the Enketo API correctly?