- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-10-22 12:15 PM
Dear community,
I'm try to upload a document in a third party API.
My problem is, that I get these error when I try to send the request out of Blue Prism.
In Postman I'm able to upload the file with a PATCH request.
This is how I build the request in Postman:
And these are my settings in Blue Prism:
I load the file in a binary data item with ‚LoadBinaryFile([Pfad Anhang])'.
I've tried to use the body content ‚single file' as in the bpdocs suggested. But the API needs the field ‚meta', so I have to set the body contet as template.
I also found out that if I leave the data item fort he file empty, the request is succesful. But of course no file is uploaded.
Can somebody help me with that issue?
Thanks a lot
Michael
------------------------------
Michael Krey
RPA Consultant
providata GmbH
Freiburg
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-11-22 05:35 AM
I had a similar issue earlier with another api. It might help to add HTTP header that calls out that the data is Base64 encoded .
See highlighted in red below.
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-10-22 03:19 PM
We've seen this scenario (a 500 error when uploading multi-part data) in the past with customers integrating Blue Prism with Appian. The issue is usually related to how Blue Prism transmits the body of the JSON file.
While you may not be using Appian in particular, this KB article may be of some use. It suggests to inspect the JSON file being transmitted by Blue Prism to check if the data is being passed in a collection or not, and adjust the endpoint to allow for (Content) -- i.e. a Collection in a single item, if possible.
------------------------------
Steve Boggs
Senior Product Support Engineer
Blue Prism
Austin, TX
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-10-22 03:34 PM
One other thing to consider is whether you need to Base64 encode the binary data before attaching it to the form submission. This is quite often the case. If you have Fiddler you can capture the Postman an BP submissions and compare the contents of the submissions to see how they differ.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-11-22 12:11 PM
Hi @Eric Wilson,
thanks for your advice with Fiddler. By analyzing the submissions I found out that one problem was with the boundary. Now I put in the boundary via parameters and not the request works without an error. Unfortunately the file is still not uploaded.
Here are my analysis oft he submissions.
It seems to me, that the file contend in the BluePrism submission isn't shown or translated correct. Could this be what you've mentioned about the Base64 encoding? If yes, how I can encode the file?
Thanks for your help and best regards
Michael
------------------------------
Michael Krey
RPA Consultant
providata GmbH
Freiburg
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-11-22 01:47 PM
From the attachments it shows that Postman is attaching the PDF to the request as raw binary data whereas the Blue Prism request is attaching data to the request in base64. So something is being sent, but it isn't being processed by the server because the server is expecting a PDF (based on Content-Type: application/pdf) whereas the content it's receiving encoded.
You're still using the same Web API that you showed in your original submission, correct? So you're passing the PDF into the request as a binary data item named Datei?
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-11-22 01:29 PM
yes I'm still using the same Web API, that's correct. And I use the data item 'Datei' to pass the PDF.
In my corresponding object I load the file with 'LoadBinaryFile' and pass it in the API.
Best regards,
Michael
------------------------------
Michael Krey
RPA Consultant
providata GmbH
Freiburg
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-11-22 03:18 PM
One issue I see is that your ending [boundary] needs to have two dashes at the end (ex. ------WebKitFormBoundary7MA4YWxkTrZu0gW--). The two dashes at the end notify the receiving server that it's the final boundary of the upload (i.e. end of the request). So in your Web API definition you could change that part of the template to look like this [boundary]--.
I'm still not sure why the data represented in the two captures looks different though. Did you pull both of these from Fiddler or did you grab the Postman capture directly from Postman? I've checked with engineering and they said they do not Base64 submissions within the product.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-11-22 05:35 AM
I had a similar issue earlier with another api. It might help to add HTTP header that calls out that the data is Base64 encoded .
See highlighted in red below.
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-11-22 04:03 PM
Thank you very much for your help. Finally it works. You really made my day!
Best regard
Michael
------------------------------
Michael Krey
RPA Consultant
providata GmbH
Freiburg
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-11-22 04:06 PM
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------