Skip to Main Content
Digital Business Automation Ideas


This is an IBM Automation portal for Digital Business Automation products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Please use the following category to raise ideas for these offerings for all environments (traditional on premises, containers, on cloud):
  • Cloud Pak for Business Automation - including Business Automation Studio and App Designer, Business Automation Insights

  • Business Automation Workflow (BAW) - including BAW, Business Process Manager, Workstream Services, Business Performance Center, Advanced Case Management

  • Content Services - FileNet Content Manager

  • Content Services - Content Manager OnDemand

  • Content Services - Daeja Virtual Viewer

  • Content Services - Navigator

  • Content Services - Content Collector for Email, Sharepoint, Files

  • Content Services - Content Collector for SAP

  • Content Services - Enterprise Records

  • Content Services - Content Manager (CM8)

  • Datacap

  • Automation Document Processing

  • Automation Decision Services (ADS)

  • Operational Decision Manager

  • Robotic Process Automation

  • Robotic Process Automation with Automation Anywhere

  • Blueworks Live

  • Business Automation Manager Open Edition

  • IBM Process Mining


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.


Status Functionality already exists
Created by Guest
Created on Sep 12, 2022

create a multipart form data http request containing a json and a file

Based on the forum post created by Pedro Botolli Santos

https://community.ibm.com/community/user/automation/discussion/how-to-create-a-multipart-form-data-http-request-containing-a-json-and-a-file-in-the-request-body?ReturnUrl=%2fcommunity%2fuser%2fautomation%2fcommunities%2fcommunity-home%2fdigestviewer%3fcommunitykey%3d8e1faacf-120e-4d65-b013-c14cc0e27c04

I'm trying to upload files to the box but I could only make it work using curl, and with curl when I try to upload large files (over 30 MB) it sometimes hangs the script execution (the script does not break but the command does not timeout).
Is there any way to make the same request using only native IBM RPA commands?

Below is the link to the Box upload file documentation and an example of the request using cURL:

API Reference


curl -i -X POST "https://upload.box.com/api/2.0/files/content" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: multipart/form-data" \ -F attributes='{"name":"Contract.pdf", "parent":{"id":"11446498"}}' \ -F file=@<FILE_NAME>


Idea priority Medium
  • ADMIN RESPONSE
    Dec 15, 2022

    You can use Create HTTP Content and HTTP Request commands to build Multipart requests.

    The following example was extracted from Create HTTP Content documentation:

    defVar --name content --type HttpContent
    
    defVar --name multicontentvar --type HttpContent
    defVar --name content2 --type HttpContent
    defVar --name content1 --type HttpContent
    defVar --name content3 --type HttpContent
    defVar --name content4 --type HttpContent
    defVar --name success --type Boolean
    defVar --name response --type String
    createHttpContent --formattype "Json" --contentheader "MyHeader1: test port:8080" --body "{\"tests\":\r\n {\r\n \"test1\":\"First\",\r\n \"test2\":\"Second\"\r\n }\r\n}" content=value
    createHttpContent --formattype "Json" --contentheader "MyHeader2: test port:8080" --parameters "test1=First,test2=Second" content1=value
    createHttpContent --formattype "Text" --contentheader "MyHeader3: test port:80" --body "<html>\r\n<body>\r\n</body>\r\n</html>" --encoding "Default" --mediatype "application/html" content2=value
    createHttpContent --formattype "Xml" --contentheader "MyHeader5: test port:8080" --body "<note>\r\n<from>Anonymous</from>\r\n<to>You</to>\r\n<messsage>We need more coffee users</message>\r\n</note>\r\n" content3=value
    createHttpContent --formattype "Xml" --contentheader "MyHeader6: test port:8080" --body "\r\n" --parameters "<from>=Anonymous,<to>=You,<messsage>=We need more coffee users" content4=value
    createHttpContent --formattype "Multipart" --boundary asdfasf --contentheader "Warning: test warning" --contentlist "content1=${content},content2=${content1},content3=${content2},content4=${content3},content5=${content4}" multicontentvar=value
    httpRequest --verb "Post" --url "https://httpbin.org/post" --formatter "Instance" --source ${multicontentvar} --noproxy success=success response=value
    logMessage --message "Sucess: ${success}\r\nResponse: ${response}" --type "Info"
  • Guest
    Reply
    |
    Dec 15, 2022

    IBM RPA supports HTTP multipart requests using the 2 commands mentioned. Please open a support ticket to get this issue assessed by the support team and engineering team. Since it looks like you're using Box, it would be easy to reproduce because IBM uses Box.

  • Guest
    Reply
    |
    Dec 15, 2022

    I had already tested the createHttpContent command, but in this case I was unable to make a request equivalent to this curl command using the native IBM RPA httpRequest commands.
    When executing the script below, the API returns that the parent field is mandatory (shown in the attached screenshot), but this value should be in the request, as it was added to the content variable in the first
    createHttpContent command.

    defVar --name content --type HttpContent
    defVar --name multicontentvar --type HttpContent
    defVar --name content1 --type HttpContent
    defVar --name success --type Boolean
    defVar --name response --type String
    defVar --name status --type Numeric
    defVar --name header --type StringDictionary --innertype String
    defVar --name accessToken --type String --value yourAccessToken
    createHttpContent --formattype "Json" --body "{\"name\":\"EMAIL_1001297729.pdf\",\"parent\":{\"id\":\"0\"}}" content=value
    createHttpContent --formattype "Bytes" --file "C:\\Users\\W00107631\\Downloads\\EMAIL_1001297729.pdf" content1=value
    createHttpContent --formattype "Multipart" --boundary asdfasf --contentlist "attributes=${content},file=${content1}" multicontentvar=value
    strDictAdd --key Authorization --value "Bearer ${accessToken}" --dictionary ${header}
    //strDictAdd --key "Content-Type" --value "multipart/form-data" --dictionary ${header}
    httpRequest --verb "Post" --url "https://upload.box.com/api/2.0/files/content" --headers ${header} --formatter "Instance" --source "${multicontentvar}" --noproxy success=success response=value status=statusCode
    logMessage --message "Sucess: ${success}\r\nResponse: ${response}" --type "Info"


    curl -i -X POST "https://upload.box.com/api/2.0/files/content" -H "Authorization: Bearer yourTokenHere" -H "Content-Type: multipart/form-data" -F attributes="{\"name\":\"EMAIL_1001297729.pdf\",\"parent\":{\"id\":\"0\"}}" -F file=@"C:\Users\W00107631\Downloads\EMAIL_1001297729.pdf"

    (access token value replaced with "yourTokenHere" for security reasons)