yesterday
Hello everyone !
I'm trying to use an API which does OCR, which means I'm supposed to send it an image file, and receive back a text which should include the text found inside the image.
I have tried to do so using only BluePrism's native web API services, but found that the multiple files option doesn't let me modify the request's body, and after looking into the forum's answers I found that it'd be better to use the http request multipart action.
Here's my problem though : When I try to send a request, I don't receive an error code but instead am told that an exception was thrown by the code stage : "one or more errors occurred", which makes it really hard for me to see what I'm doing wrong.
Below are screenshots of my overall collections, as well as that of the postman request which I am trying to base myself off in BluePrism:
If someone know what I'm doing wrong or even how I could fix my problem, I'd be very thankful !
Thank you in advance,
Bastien
yesterday
Hi Bastien,
As a first step, I'd recommend review of our Knowledge Base article, "How can I work with a multipart/form-data web request?". It contains several useful tips for getting this type of request to work within Blue Prism.
yesterday
Thank you for the additional documentation ! However, some parts remain a bit hard for me to grasp :
The documentation you forwarded did allow me to make a (I hope) functional template and use the action corresponding to the request, as I finally got a response from the API server, which states that the image cannot be loaded.
As far as I can tell, it is what was mentionned in the link you forwarded, and was mentionned in multiple other posts on this forum, which is to say that binary data gets automatically converted to base64 and is therefore unreadable by the API.
So I deduce that I need to use the HTTP Request Multipart action, but then again, I cannot figure what in the way I filled my collections is wrong in such a way that it does not even forward my request and returns a code error...
Thank you in advance for your response,
Bastien
2 hours ago
Hi @bbastien
I have used the HTTP - Multipart action for one of my process recently, please find the details on how i have used it, it may help you.
In my case we have couple certs provided by the endpoint API and that was installed into the bot machine key store, so we refere the the cert based on certificate ID. you can ignore if it is not applicable.
File Meta data collection,
File name and file path has to be provided as per the file is being posted.
As per you screenshots, you have mentioned Filemetadata.Content type = Multipart/form-data, can you try to change that to application/json and fieldname as well and let me know?
Thanks,
Nandha
36m ago
Looking at your Postman screenshot you can try setting the FieldMetadata collection to blank and try setting the FileMetadata collection's Content-Type as image/jpeg or application/octet-stream
9m ago
Yes the content type i have used was application/json because i was sending the json in a .txt file.
In you case it has to be image/jpeg or application/octet-stream as mentioned by Shashank
thanks,
Nandha