cancel
Showing results for 
Search instead for 
Did you mean: 

Upload file using API - Http ( Standard )

HariKrishna_Red
Level 2

Hi @ewilson and  Team,

We are trying to upload the files using API via postman ( Body: Form Data ) successfully, but getting error via (Body: Raw)

Kindly guide us the steps to follow, uploading the files (pdf/eml/xlsx)  using blueprism. Getting error as "bad request". 

Appreciate your response.

Thanks, 



------------------------------
Hari Krishna Reddy
------------------------------
9 REPLIES 9

ewilson
Staff
Staff

Hi @HariKrishna_Red

Are you trying to do this via the Blue Prism Web API service feature, the Utility - HTTP VBO, or some connector from the DX?

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

@ewilson

We are using Utility- Http VBO.

Thanks,



------------------------------
Hari Krishna Reddy
------------------------------

@HariKrishna_Red

Have you downloaded the latest version of the Utility - HTTP VBO from the DX, or are you using the version that comes installed with Blue Prism? If you're using the latter, you'll want to get the one from the DX as it has an action called HTTP Request - Multipart which you can use to replicate what you see in Postman. Check the user guide for details.

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson  - have you ever seen an issue with the HTTP Request - Multipart where the file being uploaded is passed to the target system but looks either corrupted or like it didn't decode? Any settings/configurations you've found that avoid that issue? All settings the same as in Postman and when executing through Postman, not seeing the same issue/docs are loaded as expected.



------------------------------
Rachel Abbott
------------------------------

Hello @Rachel Abbott

When the HTTP VBO reads the file from disk and writes it to the request stream it does so as straight binary data. The only time I've seen an issue with this is if the boundaries aren't properly set as that's what the web server uses to delineate where the file starts and ends.

Can you post a screenshot of your configuration of the VBO action? 

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hello @Rachel Abbott,

You might have this corrupt file issue if content type was left blank or not properly set. Screenshot of your FileMetadata collection would be useful to debug further.

12379.png



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

Thanks, @ewilson and @shashank.kumar280 . We made some configuration adjustments and this looks to be resolved. @shashank.kumar280 one question for you - if the ContentType is blank, shouldn't the mime type of the attachment be automatically applied? That was my understanding per the VBO documentation, and we're currently keeping that value blank (no issues since we made the other config updates). Just wanted to double check.



------------------------------
Rachel Abbott
------------------------------

Hello @Rachel Abbott,

Yes mime type is set for the binary file in the code stage automatically. However if there is a specific value required as per the API spec then it must be set in the FileMetadata collection.



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

Hi Rachel, i am facing the same type of issue, may i know what configuration adjustments you made to resolve the issue.



------------------------------
Rajan Rokkala
Business Analyst
Telstra
Australia/Perth
------------------------------