Scripted REST API with Inbound Multipart/form-data via the (scoped application)

J_r_my1
Kilo Guru

Hello everyone,

Is it possible to accept multipart/form-data via the Scripted REST API (in a scoped application)?

 

For the contexte, I am receiving from an external source a rest post message with multipart/form-data. In this this message I have two part, a json object, and an attachment. I need to use data from the json part of the payload to determine if this will be creating a new target record or updating an existing record (a coalesce value is within the JSON). The remaining parts of the payload will be attachments on the target record (and I know how to create the base64 encoded data as an attachment and have a plan on how to create the attachments from the binary data).

I have tried to use request.body.dataStream but I am not able to parse it to retrieve the different parts.

Does someone have any clue how I could parse the data I receive?

2 REPLIES 2

bbgaurav
Tera Contributor

@J_r_my1 : did you get any success on this? 

No. We asked our external to change his rest message, so it would be possible for us for the integration