Does the following work for you:
See https://docs.mendix.com/refguide/call-rest-action#5-response
If that does not work, grab the contents from the JSON and use communitycommons functions to decode to a file document.
I'm afraid not. I've already tried that. It saves the file, but without specification as PDF.
Maybe you need to explicitly set the file name, not sure whether that would help.
And doing it yourself with the JSON and community commons function?
Hello,
I have a similar requirement.
Which function should I use to decode the http response string to a System.File?
I tried with the community common function, so first I store the string from response
Then I tried with “File document from file”, but this obvioulsy expects a file existing on the file system.
I rather need a function which decodes it directly from the response string (see ResultString above).
Caused by: com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.io.FileNotFoundException: Invalid file path
at ComosDocuments.API_Document_GetRevisionPDF (JavaAction : 'File document from file')
Using a REST call and store the result as a FileDocument should work. Alternatives: