2024 Nov 26 4:00 PM - edited 2024 Nov 26 4:42 PM
Dear Experts,
I am receiving the PDF file in base64 encoded format in CPI and I need to update that through the below API but I am bit confused as how to send the PDF content . Only below information is available in the API specification . Could you please suggest how can I perform PUT operation for updating the PDF content.
I am able to update perfectly from POSTMAN, unable to replicate the same in CPI. Please suggest how can I pass file
Request clarification before answering.
Hi, You need to create Payload in multiform data and send the same to Endpoint URL.
above blogs may help
with regards
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am now able to update the document in Ariba but the PDF is not opening there . It seems the decoded PDF is breaking in CPI.
Step- 1 : Getting base64 encoded PDF
Step-2: Decoding via standard Decoder
Step-3: Forming Request Body with the following Groovy before PUT call
def Message processData(Message message) {
def body = message.getBody(String);
body = body.replaceAll("\n", "\r\n");
def multipartBody = """--cpi\rContent-Disposition: form-data; name="file"; filename="DOC_T_V3.pdf"\r\nContent-Type: application/pdf\r\n\r\n""" + body + """\r\n\r\n--cpi--""";
message.setBody(multipartBody);
return message;
}
Please suggest what is missing here.
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 8 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.