Making a multipart API call in Unqork requires a Plug-In component like other API calls, but you'll also use a Calculator component to define the MIME Types (Multipurpose Internet Mail Extensions) included in your request. Let's look at a common example of sending a Base64 encoded PDF in a POST call.
You do not need to use multipart API calls for Unqork services. This example shows the steps you’d follow once you’ve set up an integration that requires a multipart API call. Meaning, this guide is only an example and you cannot perform this call in Express View.
These instructions assume you have a new module open, saved, and with a title.
Configuration
Select the tab that corresponds to your Unqork Designer experience:
Configure the Hidden Components
The first two Hidden components will store the PDF MIME Type and the Base64 encoding for the PDF. Later, you’ll set up a Calculator component to combine them.
In the Module Builder, drag and drop the first Hidden component onto your canvas.
In the Property ID and Label Text fields, enter
base64OfFile.Click Save Component.
Drag and drop a second Hidden component onto your canvas, placing it below the first Hidden component.
In the Property ID and Label Text fields, enter
mimeType.In the Default Value field, enter
application/pdf.In this case, our MIME type is a PDF. You’ll replace
application/pdfwith whatever MIME type you’re using.Click Save Component.
Configure the Calculator Component
This Calculator component combines the values from your first two Hidden components in the encodedFileURI you’ll add in the next step.
Drag and drop a Calculator component onto your canvas, placing it below your Hidden components.
In the Property ID and Label Text fields, enter
calcMimeType.In the Inputs table, enter the following:
#
Source
Alias
Required
1
base64OfFile
pdf
(checked)2
mimeType
mime
(checked)In the Outputs table, enter the following:
#
Source
Formula
1
encodeFileURI
=CONCATENATE('data:',mime,';base64,',pdf)
.png)
Click Save Component.
Configure the Hidden Component
The third Hidden component in this configuration serves as the output for the Calculator component.
Drag and drop a Hidden component onto your canvas, placing it below your Calculator component.
In the Property ID and Label Text fields, enter
encodedFileURI.Click Save Component.
Configure the Plug-In Component
This Plug-In component handles the API call. Here, you'll specify that you're making a multipart API call. Again, these instructions assume that you've already set up an API in Services Administration. In the following steps, you'll select that API from the Services drop-down.
Drag and drop a Plug-In component onto your canvas, placing it below your
encodedFileURIHidden component.In the Property ID and Canvas Label Text fields, enter
pluginMultipartApiCall.From the Internal Services drop-down, select your API. Ensure the Request Type is set to POST.
Set Make a Multipart API Call to
(ON).A box displays letting you enter an Alternative Multipart Sub-Type. If your API requires a type other than multipart/form-data, enter it here.
In the Inputs table, enter the following:
Property ID
Mapping
Required
encodedFileURI
file
(checked)
Click Save Component.
Configure the Button Component
The Button component trigger your Plug-In component when clicked, ultimately executing the API call.
Drag and drop a Button component onto your canvas, placing it below your Plug-In component.
In the Property ID field, enter
btnsubmitMultipartCall.In the Label Text field, enter
Submit Multipart Call.From the Action Type drop-down, select Event.
From the On Click drop-down, select pluginMultipartApiCall.

Click Save Component.
Save your module.
Configure the Hidden Components
The first two Hidden components will store the PDF MIME Type and the Base64 encoding for the PDF. Later, you’ll set up a Calculator component to combine them.
In the Module Builder, drag and drop the first Hidden component onto your canvas.
In the Property ID and Label Text fields, enter
base64OfFile.Click Save.
Drag and drop a second Hidden component onto your canvas, placing it below the first Hidden component.
In the Property ID and Label Text fields, enter
mimeType.In the Default Value field, enter
application/pdf.In this case, our MIME type is a PDF. You’ll replace
application/pdfwith whatever MIME type you’re using.Click Save.
Configure the Calculator Component
This Calculator component combines the values from your first two Hidden components in the encodedFileURI you’ll add in the next step.
Drag and drop a Calculator component onto your canvas, placing it below your Hidden components.
In the Property ID and Label Text fields, enter
calcMimeType.In the Inputs table, enter the following:
#
Property ID
Alias
Required
1
base64OfFile
pdf
(checked)2
mimeType
mime
(checked)In the Outputs table, enter the following:
#
Property ID
Formula
1
encodeFileURI
=CONCATENATE('data:',mime,';base64,',pdf)

Click Save & Close.
Configure the Hidden Component
The third Hidden component in this configuration serves as the output for the Calculator component.
Drag and drop a Hidden component onto your canvas, placing it below your Calculator component.
In the Property ID and Label Text fields, enter
encodedFileURI.Click Save.
Configure the Plug-In Component
This Plug-In component handles the API call. Here, you'll specify that you're making a multipart API call. Again, these instructions assume that you've already set up an API in Services Administration. In the following steps, you'll select that API from the Services drop-down.
Drag and drop a Plug-In component onto your canvas, placing it below your
encodedFileURIHidden component.In the Property ID and Canvas Label Text fields, enter
pluginMultipartApiCall.From the Internal Services drop-down, select your API. The Data Source URL automatically populates.
Set the Request Type as POST.
Set Make a Multipart API Call to
(ON).A box appears letting you enter an Alternative Multipart Sub-Type. If your API requires a type other than multipart/form-data, enter it here.
In the Inputs table, enter the following:
Property ID
Mapping
Required
encodedFileURI
file
(checked)

Click Save.
Configure the Button Component
The Button component triggers your Plug-In component when clicked, ultimately executing the API call.
Drag and drop a Button component onto your canvas, placing it below your Plug-In component.
In the Property ID field, enter
btnsubmitMultipartCall.In the Label Text field, enter
Submit Multipart Call.Setthe Action Type as Event.
From the On Click drop-down, select pluginMultipartApiCall.

Click Save & Close.
Save your module.