I am trying to write an API using the business logic. The functionality is to sent a POST request containing a JSON and the 3rd party responds with a generated PDF file.
If I connect the Network API http method to my custom API block I can successfully authenticate and there is a return payload (see second screenshot). I want this returned file to be stored in the file server so that I can send it back to the client side for display/print etc. I assume I need a “create file” block but I can’t figure out how to set it up correctly.
If I do it this way I need to use the Read File file path for the entire external API request? I tried attaching an HTTP request to the Read File file path block but this resulted in: 400 - Request path contains unescaped characters error.
The issue is with the HTTP block, it always use encoding “utf8” that’s why it always returns the file content as text.
We are going to add a new option to the HTTP block in order to return List of Bytes and as result it will be possible to save a file in the Backendless Files using this combination.