Thank you @snv ! I am afraid this will not work. While at it, if I pass it through http://server:port/api/method/frappe.utils.print_format.download_pdf? (frappe’s module) it works just fine, but if pass it through my custom app’s API (http://server:port/api/method/myapp.myapp.myapi.download_pdf?) it has no use. I have not delved into it but it seems as if the “flags” property of the returned object of frappe.get_doc() needs to be populated…
Just to let you know my own function “dowload_pdf()” is part of my public API where the HTTP POST initiator is not being authenticated. I am simply impersonating the “Administrator” user by calling:
frappe.set_user("Administrator")
Like I said earlier if the request comes through an authenticated user all works fine. My problem is that the caller of this API cannot populate the the HTTP headers to send me: