How to Upload a Document/File to an External API Using Multipart/Form-Data in Creatio?
Hi Community,
I am currently working on an integration where I need to upload documents/attachments from Creatio to an external API.
The external API expects the document to be sent using multipart/form-data in the request body payload.
The current integration flow is:
Creatio → Web Service → External API
However, I am unable to find an OOTB option to pass the actual file/document as a multipart/form-data request body parameter.
I would like to know:
- Is it possible to send a file from Creatio to an external API as
multipart/form-datausing the OOTB Web Service functionality? - If not, what is the recommended approach to achieve this?
- Can this be implemented using a Script Task or custom C# code in a Business Process?
- Is there any recommended Creatio API or marketplace component that can help with uploading files to an external API using
multipart/form-data?
Any guidance, sample code, or recommended approach would be greatly appreciated.
Thanks in advance for your help!
Like
Hello,
Currently it is not possible to send a file from Creatio to an external API using the out-of-the-box Web Service functionality.
The recommended approach is to use a Script Task within a business process. In the Script Task, you can retrieve the required file as a byte array and create a MultipartFormDataContent object, which can then be used to send the file to the external API as part of a multipart/form-data request.
At this time, we are not aware of any Marketplace add-on or component that provides this functionality out of the box.
Thank you for the clarification and for suggesting the Script Task approach.
I would like to explore whether there are any other feasible options for retrieving and sending Case attachments from Creatio.
Specifically, is there any Creatio OOTB API or standard endpoint that can be used to retrieve a Case attachment/document in a format such as byte array, Base64, binary stream, or file download URL? Once the file is retrieved, we can modify the external API request parameters or payload format accordingly.
For example, would it be possible to:
- Retrieve the Case attachment using the Creatio File API or OData API.
- Get the attachment as a downloadable file or binary response.
- Retrieve the file content as Base64 or a byte array and send it to the external API.
- Use any other standard Creatio API or integration mechanism to transfer the attachment.
Our main requirement is to get the Case attachment from Creatio in any suitable format that can be accepted by the external API. We can then work with the external API team to change the request parameter or payload format based on the available file format.
Could anyone please suggest the recommended or feasible approach for achieving this using Creatio APIs or OOTB functionality?