Hi Suraj,
You can always click on documentation link of BPM REST services to understand how to use them
According to the docs (https://www.ibm.com/docs/en/baw/19.x?topic=instance-post-add-document), you can provide your document data to the rest service via 2 ways:
- Via data params
- Or using multipart form data directly in your request
Method 1 - Via 'data' ParamRest URL:
https://{{yourBPMHostName}}/rest/bpm/wle/v1/process/12672?action=addDocument&name=Test+Add+Doc+Via+Rest&hideInPortal=false&docType=file&parts=all&accept=application%2Fjson&override-content-type=text%2Fplain&data=test
For demo purposes, my document content is simple, just a 'test' string. But in your case, you probably have to encode your file content into base64 string and provide the encoded string into 'data' param.
Method 2 - Form a multipart form data in the http request
So multipart/form-data is a content-type for uploading documents. For this, your POST http request should have a header like this
------------------------------
Thong Huynh
Sydney NSW
------------------------------
Original Message:
Sent: Wed April 14, 2021 01:44 PM
From: Suraj Sawant
Subject: Multipart form data file upload from IBM BPM
Hi All,
We are trying to upload document using rest services and the input is 'multipart form-data'.
Has anyone of us worked on the same implementation, if Yes, please share as we are facing issue while forming the request from BPM
Thanks in advance.
------------------------------
Suraj Sawant
------------------------------