Blue Prism Product

last person joined: 39 minutes ago 

This community covers the core Blue Prism product.

Expand all | Collapse all

sending .xlsx file using POST API.

Jump to Best Answer
  • 1.  sending .xlsx file using POST API.

    Posted 07-19-2021 06:31
    I have a requirement of sending .xlsx file using POST API.

    I guess Ideal way of doing this is to use Single File option in WEB API configuration and passing Binary file from process.

    But unfortunately the WEB API definition does not support the Binary File, even when used Binary File option from POSTMAN , it throws server error.

    There are two options available it seems

    1 ) Form-data : When I use this option in POSTMAN, it works fine but not sure how to use this option in Blueprism as Blueprism supports only below option

    ------------------------------
    Kirtish Trivedi
    ------------------------------


  • 2.  RE: sending .xlsx file using POST API.

    Posted 07-26-2021 14:58
    Hi @Kirtish Trivedi,

    Is the service that you're posting the spreadsheet something internal? Just wondering if you can work with the developer of that service to account for the file upload using the BP Web API service feature? If not, another option would be to use the Utility - HTTP VBO​ available on the DX.

    Cheers,

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



  • 3.  RE: sending .xlsx file using POST API.

    Posted 07-28-2021 01:03
      |   view attached
    Hi Kirtish,

    If you have a REST API endpoint that supports a single straight binary file, you can use the native Web API Services feature by setting the Body Content to Single File and then find ways to upload the file in binary format to the exposed binary parameter.

    If you have a multipart/form-date involving a binary field, I am afraid you are not able to use Web API Services, neither a generic VBO like Utility - HTTP VBO to achieve this. The main reason is the data format of the Body field, is in Text/String, which is not capable of storing binary data. In the case of Web API Services feature, it would implicitly convert any binary fields to Base64 encoding, resulting in the file become not readable once uploaded by the endpoint. You must either devise a heavily customised VBO, or use a pure code stage approach to achieve this. I have created an example by using the code sample from https://briangrinstead.com/blog/multipart-form-post-in-c/ before for a customer. I have attached here for your reference. The said example works with Microsoft Cognitive Services > Analyze Image endpoint (https://westus.dev.cognitive.microsoft.com/docs/services/computer-vision-v3-2/operations/56f91f2e778daf14a499f21b) . The endpoint accepts three different types of inputs, and the example implements "multipart/form-data" specifically.

    ------------------------------
    Bruce Liu
    Senior Product Consultant, Professional Services
    Blue Prism
    Australia/Sydney
    ------------------------------

    Attachment(s)

    zip
    Multipart_FormData.zip   25 KB 1 version


  • 4.  RE: sending .xlsx file using POST API.

    Posted 07-28-2021 06:58
    Thank you for response @Bruce Liu,

    Unfortunately API does not supports Binary file. I went with HTTP VBO option action HTTP Request Multipart. It is working fine with Small size file but throwing error with Large file size. I will post the detailed error info in other thread

    Thank you ​

    ------------------------------
    Kirtish Trivedi
    ------------------------------



  • 5.  RE: sending .xlsx file using POST API.

    Posted 07-28-2021 07:45
    Hi Kirtish,

    Just to be precise, API services does support binary, just not binary in a multipart/form-data body.

    Also, I would ask you to check again if you have managed to achieve it using HTTP VBO. Try to access the file you have uploaded, to see if you can open it using whichever application it is designed for. I have a feeling that the file will be shown as corrupted. Successfully invoking the API endpoint does not necessarily mean the file has been uploaded correctly. This is important, otherwise you will be wasting quite a lot of time devising unnecessary workaround.


    ------------------------------
    Bruce Liu
    Senior Product Consultant, Professional Services
    Blue Prism
    Australia/Sydney
    ------------------------------



  • 6.  RE: sending .xlsx file using POST API.

    Posted 07-28-2021 08:04
    Hi @Bruce Liu,

    Yes I am able to Upload the smaller file using newly added Multipart action of Utility HTTP.

    But while uploading larger file size , it throws an error.

    It throws below error
    Error : 
    Could not execute code stage because exception thrown by code stage: Object reference not set to an instance of an object.

    When I remove the Try catch block , it shows below error 
    Could not execute code stage because exception thrown by code stage: The operation Timed out

    Hence I assume this is related to timeout. It takes around 2 min 10 seconds before it throws error.

    Also it is working from POSTMAN hence nothing wrong from API side

    Is there anything needs to be done to increase timeout limit from Blueprism or is there any other issue ?


    ------------------------------
    Kirtish Trivedi
    ------------------------------



  • 7.  RE: sending .xlsx file using POST API.
    Best Answer

    Posted 07-28-2021 08:21
    Hi Kirtish,

    Ok, I see the HTTP VBO has been updated to include the mulitpart/form-data support. You should be able to work with this.

    Try to add a line (i.e. line 3 in the screenshot below) in the code stage  of the action "HTTP Request Multipart" to set the timeout to 100000 milliseconds (100 seconds), from 10000 milliseconds (10 seconds). This should resolve your issue. You can find this Microsoft article here in relation to this property.



    ------------------------------
    Bruce Liu
    Senior Product Consultant, Professional Services
    Blue Prism
    Australia/Sydney
    ------------------------------



  • 8.  RE: sending .xlsx file using POST API.

    Posted 07-28-2021 10:27
    Thank you @Bruce Liu,

    Setting up request.timeout worked :)​

    ------------------------------
    Kirtish Trivedi
    ------------------------------



  • 9.  RE: sending .xlsx file using POST API.

    Posted 07-28-2021 14:44
    @Kirtish Trivedi,

    Glad to hear @Bruce Liu's suggestion has gotten you over the hurdle. I'll add an action to our backlog to update the HTTP VBO to include a configurable timeout parameter.

    Cheers,
    ​​

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



Welcome to the Blue Prism Product Community!

Whether you’re looking to manage a complex infrastructure, maintain security and compliance, bring new products to market faster, or gain operational speed and agility in an uncertain economy, Blue Prism delivers — with the flexibility you need to create the business you want. From deployment on-premise, through a cloud service provider or as SaaS, to a skillful and adaptable digital workforce that continually expands to meet your enterprise needs, you can gain enhanced operational insight and control while your people reclaim the time they need to focus on great work.

Product PageKnowledge BaseBlue Prism Training Offering

FAQs

Blue Prism is intelligent automation — business-developed, no-code automation that pushes the boundaries of robotic process automation (RPA) to deliver value across any business process in a connected enterprise.

A combination of RPA with expanded cognitive and AI capabilities, Blue Prism is different than other automation technology on the market. With one Blue Prism license, you gain instant access to an already AI equipped digital workforce, along with the tools you need to build and delegate automations. Click here for more information on Blue Prism and Intelligent Automation.
To learn more about how Blue Prism can help your organization and how much it will cost to get started, please Contact our Sales department.
Blue Prism can be downloaded from our customer portal. If you would like to consume or download any material it is necessary to create an account on the Portal. Once you have registered, you can access the download options for Blue Prism here.
Yes! Installed on your own machine and supported by our training materials and product documentation, you can use all the features of the full enterprise product for free with our Blue Prism Trial – giving you the opportunity to learn the basics before moving to a full production implementation. Click here for more information and to download the trial.
Yes! You can access our known issue list for Blue Prism from our Support Portal.
Regardless of your industry, Blue Prism’s Digital Workforce can adhere to strict governance and compliance standards without limiting productivity. Click here for more information on how your industry can benefit from Blue Prism.