- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-07-19 10:41 PM
We are able to call the service successfully using Postman, but when using Web API feature of Blue Prism latest version 6.5 we are having following observations.
1. When using Template dropdown option in the Request, it is sending the whole data in json format instead of multi-part form data as expected by the service.
2. When using Single or Multi File option, we do not see a way to send additional attributes in the body as expected by service
3. We also wrote a custom code to send the information using multi-form, but even that ended up sending information in raw format.
Any experience on above requirement?
------------------------------
Ambrish Srivastava
Architect
Persistetnt Systems Inc
America/New_York
------------------------------
Answered! Go to Answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-05-20 04:53 PM
Many thanks for sharing this.
I am still having a few issues trying to send a multipart/form-data POST request.
What variable type is your [fileValue] parameter?
Thanks,
Harrison
------------------------------
Harrison Jardine
Consultant
Protiviti
Europe/London
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-05-20 06:04 PM
File value is the actual Binary data for the file. The blue prism process that call the multipart/form-data api will extract the file in a binary format using file system vbo and pass it on here
------------------------------
Bimal Sebastian
Consultant
Blueprism
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-06-20 04:00 PM
When sending the file using Binary I am unable to open it on the target system as I think it is getting corrupted in some way. They have asked if I can send the file using a Byte Array.
Is this possible using the approach above?
Thanks,
Harrison
------------------------------
Harrison Jardine
Consultant
Protiviti
Europe/London
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-07-20 01:14 AM
I'm attempting to setup the API endpoint to upload a file, it works in Postman, but when I am trying to set it up in Blue Prism I'm having some issues, I've attempted to recreate what you have in the image but what should the boundary be? Filename should of course be the file's name, and filevalue should be the binary data I'm assuming.
Thank you for your help,
Tracy
------------------------------
Tracy Schultz
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-07-20 06:30 AM
The boundary is any arbitrary character. As a matter of fact it can be hardcoded as well if you chose to. Most api end points dont care what the boundary is, as long as there is a boundary.
To be more elaborate, Boundary is a http protocol requirement. This essentially is a way to tell where a particular "part" in a "multi-part" form begins and end.
------------------------------
Bimal Sebastian
Consultant
Blueprism
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-07-20 05:16 PM
@Bimal Sebastian
Looking in Postman at the headers needed for the API it has the following needed headers. Can you shed light on what headers are included as part of the API integration for sending files or file for the body of a POST?
We can easily get the number of bites using a calculation and we can set the Content-Type header easily, however is Content-Length sent automatically or can we set it? Knowing what headers are sent or possible to send would be helpful. If needed I can include the Request Headers and Request Body from postman where it worked minus authentication items.
Content-Length: 1179190
Any and all help is much appreciated.
Thanks,
Tracy
------------------------------
Tracy Schultz
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-07-20 05:28 PM
Think I'm starting to understand. Looking at the raw log from Postman I'm seeing the following.
Content-Type: multipart/form-data; boundary=--------------------------035755082283824938336703
Content-Length: 1179190
----------------------------035755082283824938336703
Content-Disposition: form-data; name="file"; filename="1718367-2019-1231-MID; 1040.pdf"
<1718367-2019-1231-MID; 1040.pdf>
----------------------------035755082283824938336703--
So would I want this as the body template?
[boundary]
Content-Disposition: form-data; name="file"; filename="[filename]"
[filedata as binary]
[boundary]--
And if so then add these headers to the action?
Content-Type: multipart/form-data; boundary=[boundary]
Content-Length: [length of file binary]
Apologize for all the questions but I feel like I'm on the edge of understanding.
------------------------------
Tracy Schultz
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-07-20 08:20 PM
Ok I've set this up as my template.
Content-Length: [Content Length]
[Boundary]
Content-Disposition: form-data; name="file"; filename="[File Name]"
[File Data]
[Boundary]--
I've also added these headers
Content-Type multipart/form-data; boundary=[Boundary]
Cache-Control no-cache
When I run it I'm getting this error.
Unexpected error Error during Web API HTTP Request
HTTP Status Code: 400
HTTP Response Content: {"key":"ERROR_HAS_OCCURRED","value":"Unexpected end of MIME multipart stream. MIME multipart message is not complete."}
Here's what I have from Postman.
Cache-Control: no-cache
Host: api.thomsonreuters.com
Content-Type: multipart/form-data; boundary=--------------------------035755082283824938336703
Content-Length: 1179190
----------------------------035755082283824938336703
Content-Disposition: form-data; name="file"; filename="1718367-2019-1231-MID; 1040.pdf"
<1718367-2019-1231-MID; 1040.pdf>
----------------------------035755082283824938336703--
Not seeing what I'm getting wrong on this.
------------------------------
Tracy Schultz
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
31-07-20 11:30 PM
------------------------------
Tracy Schultz
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-20 02:20 PM
I use a calculation stage to read the file to binary, and store in the collection "File" field:
------------------------------
Chris Hogan
Senior Ecosystem Architect
Blue Prism
------------------------------
