Expose REST API to receive binary file
Application Type
Traditional Web, Reactive
Service Studio Version
11.50.9 (Build 46307)
Platform Version
11.13.0 (Build 31007)

Hello, I want to expose REST API to receive binary file to store in table. Can anyone guide on how to do that?

Then, I would need to consume the same REST API to upload a document from another application in OutSystems.

Hi Khurram,

it's very simple, expose a REST API with the following method.

Then inside the method just insert the input variable binary into the table you want to.

regards


I don't know if it will happen, but in APIs generally, you cannot passe directly Binary data, you need to convert to Base64 on exposing and on consuming convert to binary.

Right, José?

Kind regards,

Márcio

Hi Marcio,

I think if you set the Request Format of the consuming method to Binary, it should be ok. Not 100% sure though.

Regards

Hi José, As per my tries, it didn't work as simple. Perhaps it would work if we convert to Base64. Anyhow I used Multipart/form-data component from Forge as an example and acheived it. Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.