How to build a module around an ASP.NET Core API that returns a FileResult

I have an ASP.NET Core Web API that returns a document as a FileResult. When I call that API in a module I am getting an error that says “The operation failed with an error. Invalid module output. Expected Object, but found Uint8Array.” How can I read the value of this API and / or what should a Document request return?

@Matronix You always have to return an object inside of your API or you need to create a Make Connector which specifies it’s a downloadable file which is returned.

1 Like

I am returning the file fine but the header contains the content-length, content-type, and content-disposition. How do I read those values? I am able to return the file to a buffer.

I recommend you look into the App development documentation: https://docs.integromat.com/apps/app-blocks/api/buffer
If you can’t figure it out, you can always hire a Make Expert to develop this for you.

I have read the documentation. There is nothing in the documentation about reading the header to get that information. I already have the buffer filled with the data.