cancel
Showing results for 
Search instead for 
Did you mean: 

Web API Services - To upload a file using multipart form data

AbhilashM
Level 3
Hi Dear Community,

I have tried using form data module in postman to successfully upload the file to the target application. However, in the blue prism Web API services section - I am not able to successfully configure the API for upload.

The API documentation consumes the parameters as query params and use form-data to accept the file with multipart/form data and boundary established. Can you please guide me on how to go about setting this up in Blue Prism?

Thank you
Abhilash M
RPA Developer
Lowe's Companies.

------------------------------
Abhilash M
------------------------------
19 REPLIES 19

Hi Abhilash,

If you can post a screenshot of your postman configuration that would be helpful. The Utility - HTTP has a specific action to deal with multipart. Have you tried that already? 

For using the WebAPI you will have to set the params in the Body Template. 

There is a sample request in this thread https://community.blueprism.com/communities/community-home/digestviewer/viewthread?GroupId=145&MessageKey=52119c58-2f30-465b-b65e-61862a3d75fe&CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&tab=dig...

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------

Hi Shashank,

Thank you for your response.

I have attached the snapshot. The URL is composed of several query params.
The body is of type form-data which has 3 parameters and the parameter file is of type "file"

This setup works just fine. I need to figure out a way to apply similar functionality in BluePrism.

I did go through the thread you shared regarding params in Body Template- I have trouble with the fileValue param at the end.
Currently the error Blue Prism throws with the setup Bimal suggested in the screenshot is:-

Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 404
HTTP Response Content: {"timestamp":"2022-06-08 12:31:15","status":404,"error":"Not Found","message":"No message available","path":"/<<Request URL>>"}

Also I have not tried the HTTP Utility yet and if you could share more details on that which will be helpful. I only see a HTTP VBO but not the extended in the current setup. Do let me know if the standard one works just fine.

Thank you
Abhilash M

------------------------------
Abhilash M
------------------------------

Hi Abhilash,

You can get the latest Utility - HTTP from https://digitalexchange.blueprism.com/dx/entry/3439/solution/utility---http

Using the utility is quicker than building the body template yourself.

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------

Thank you Shashank, I will certainly give this a go and keep the community updated.

Thank you
Abhilash M

------------------------------
Abhilash M
------------------------------

Hi Dear Community,

Would there be any community user who can help me with the file meta data and field meta data collection examples used in the HTTP-Utility VBO.

I have used the certain sample inputs to the two collections but seems to be missing something important.

Current error : The remote server returned an error: (503) Server Unavailable.

Thank you 
Abhilash M

------------------------------
Abhilash M
------------------------------

Hi @AbhilashM

You are getting the error from the service. So you are calling it correctly.

The 5xx errors, are errors from the server part.

Which action are you calling it?


See you in the Community, bye 🙂

------------------------------
Pablo Sarabia
Solution Manager & Architect
Altamira Assets Management
Madrid
------------------------------

Hi Abhilash,

The field metadata should contain all the key/value pairs other than the binary file.

The binary file related metadata goes in the file metadata collection.

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------

Updates I have so far -

I have used the file meta data collection to include the key/value pair values used in postman under the form-data setup
I have used the file meta data collection to only pass the file path as the other params (filename, fieldname and content type are optional)
Could you please help me with the header content-type in this scenario?

Thank you
Abhilash M

------------------------------
Abhilash M
------------------------------

The metadata collection for File can include fieldname as "file" and content type as "application/octet-stream".

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------