Send File Attachment in Connect-Rest using "multipart/form-data" in Pega 7.3.1

Is multipart-formdata is supported in Pega7.3.1?

We have a requirement to send the document in Connect-REST as an attachment in request. Pega version is Pega7.3.1.

As per the help guide (https://customer-coml-dev731.cmp.dev.cba/prhelp/procomhelpmain.htm#rule-/rule-connect-/AttachmentsSOAPdotNetHttp.htm?Highlight=pyRequestAttachmentPage) and multiple PDN forums, implemented as below. But it is not working.

pyRequestAttachmentPage is populated in prior to calling the Connect-REST and below are mappings.

Tried pyAttachTypes(1) = application/pdf, application/json and multipart/form-Data. But same error is received. Also, request is not having the Attachment details.

Error: As per the request from the Log file, there is no attachment in the Request body. Service provider system is not receiving the attachment.

------------------HTTP REQUEST CONTENTS------------------

Request Headers: {Authorization=Bearer eyJh, Content-Type=multipart/form-data; boundary=jeKANG1-9Ks5mMY_4WKNIQUgpBS4RZikIvU}

Request Message Data: 613834 bytes to be sent

<?xml version="1.0"?>

ABCD==

AD12345

------------------END HTTP REQUEST CONTENTS------------------

------------------HTTP RESPONSE CONTENTS------------------

Response Headers:

Connection: keep-alive

Content-Length: 675

Content-Type: application/json

vary: Origin

x-request-id: a95e32d7-9c54-45d9-8114-ff8db3ae9a0c#1012176

Response Message Data: 675 bytes received

{“entities”:,“entityConfidences”:,“modelMetadata”:“…”,“pageFailures”:[{“message”:“unable to process file: unable to process file: no file content on input”,“pageIndex”:“-1”,“type”:“General”}],“pages”:{}}

----------------END HTTP RESPONSE CONTENTS------

@RajeswariKilaru please see Connect-Rest Integration with multipart/mixed

Pega 7.3.1 does support sending attachments as multipart/form-data in Connect-REST. You need to create a page of class Data-ServiceMessage named pyRequestAttachmentPage and set the properties .pyAttachNames(1), .pyAttachValues(1), .pyAttachTypes(1), and .pyAttachFileNames(1). The .pyAttachNames(1) property should contain the name of the parameter, not the name of the attachment. If you’re still facing issues, it might be due to other factors such as the specific configuration of your Connect-REST rule or the service you’re trying to connect to

This is a GenAI-powered tool. All generated answers require validation against the provided references.

Sending attachment as multipart in connect REST not working

multipart REST request is failing when upgrade from Pega 7.1 to pega 8.5

Sending Excel as multipart Via Connect Rest is not working.

How to send file as Form data to Connect REST API

Connect-Rest Integration with multipart/mixed

If you believe the product is not working as documented, please log a support issue via the MSP.

@MarijeSchillern Thanks for the reply.

But all the same steps I tried, still there was no luck before.

Now I corrected .pyAttachTypes(1) value to “application/octetstream”, where the issue resolved and Integration started working as expected.