添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
奋斗的荔枝  ·  GitHub ...·  1 年前    · 
果断的沙滩裤  ·  org.springframework.tr ...·  1 年前    · 

I need to integrate with a multipart/mixed REST service in Pega. Can anyone share me the procedure on how to achieve this and what are all needs to be set in the headers and request?

(“Content-Type”,“multipart/mixed; boundary=\“---Content Boundary\“”)

Thanks

Naveen

We don't support multipart/mixed OOTB. We only support multipart/form-data via the use of pyRequestAttachmentPage.

If you do want to work with a scenario specific to multipart/mixed , then you can use REST connector to construct such a request. These are the changes you need to make:

1) First, understand how multipart works. Read this: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

2) In REST Connector POST request header, set Content-Type to multipart/mixed;boundary=<enter any set of alphanumeric chars here>, say multipart/mixed;boundary= abc

3) Manually construct the POST request body as below and set the entire value to a string property, say, pyNote:

-- abc

Content-Type: application/json

<blank line here>

<your JSON body goes here>

<blank line here>

-- abc --

4) In REST Connector POST Message Data section, select Map from as Clipboard and Map from key as .pyNote.

In the above example, "abc" is used as boundary separator between each "part". You just need to construct one part for your requirement.

******** Edited by Moderator Marije to add recommended documentation  *********

The above solution is specifically aimed for unsupported multipart/mixed scenario.

We don't support multipart/mixed OOTB. We only support multipart/form-data via the use of pyRequestAttachmentPage.

If you do want to work with a scenario specific to multipart/mixed , then you can use REST connector to construct such a request. These are the changes you need to make:

1) First, understand how multipart works. Read this: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

2) In REST Connector POST request header, set Content-Type to multipart/mixed;boundary=<enter any set of alphanumeric chars here>, say multipart/mixed;boundary= abc

3) Manually construct the POST request body as below and set the entire value to a string property, say, pyNote:

-- abc

Content-Type: application/json

<blank line here>

<your JSON body goes here>

<blank line here>

-- abc --

4) In REST Connector POST Message Data section, select Map from as Clipboard and Map from key as .pyNote.

In the above example, "abc" is used as boundary separator between each "part". You just need to construct one part for your requirement.

******** Edited by Moderator Marije to add recommended documentation  *********

The above solution is specifically aimed for unsupported multipart/mixed scenario.

The content type "multipart/form-data" should be used for submitting forms that contain files, non-ASCII data, and binary data.

For the latest documentation on implementing a generic use case to send attachment through connect Rest rule please check the following:

File attachment configuration in REST and SOAP integrations

Use case: Send file attachments from a repository

Mapping the data for a POST response for a Connect REST rule

*******************************************************************************************


View reply inline

Hi Praneeth

Our requirement is a Connector. We need to connect with a multipart/mixed REST API which accepts json request as well as a file. Our requirement is to update only the json part and we would not send any file in the request. We formed the json request in the body and not getting any success. Any mandatory properties that need to be set while integrating with this kind of multipart APIs. I gave the header as multipart/mixed; boundary=---Content Boundary (as given by the API team) in the Content-Type header in the connector rule.

Thanks in Advance

Naveen

We don't support multipart/mixed OOTB. We only support multipart/form-data via the use of pyRequestAttachmentPage.

If you do want to work with a scenario specific to multipart/mixed , then you can use REST connector to construct such a request. These are the changes you need to make:

1) First, understand how multipart works. Read this: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

2) In REST Connector POST request header, set Content-Type to multipart/mixed;boundary=<enter any set of alphanumeric chars here>, say multipart/mixed;boundary= abc

3) Manually construct the POST request body as below and set the entire value to a string property, say, pyNote:

-- abc

Content-Type: application/json

<blank line here>

<your JSON body goes here>

<blank line here>

-- abc --

4) In REST Connector POST Message Data section, select Map from as Clipboard and Map from key as .pyNote.

In the above example, "abc" is used as boundary separator between each "part". You just need to construct one part for your requirement.

******** Edited by Moderator Marije to add recommended documentation  *********

The above solution is specifically aimed for unsupported multipart/mixed scenario.

We don't support multipart/mixed OOTB. We only support multipart/form-data via the use of pyRequestAttachmentPage.

If you do want to work with a scenario specific to multipart/mixed , then you can use REST connector to construct such a request. These are the changes you need to make:

1) First, understand how multipart works. Read this: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

2) In REST Connector POST request header, set Content-Type to multipart/mixed;boundary=<enter any set of alphanumeric chars here>, say multipart/mixed;boundary= abc

3) Manually construct the POST request body as below and set the entire value to a string property, say, pyNote:

-- abc

Content-Type: application/json

<blank line here>

<your JSON body goes here>

<blank line here>

-- abc --

4) In REST Connector POST Message Data section, select Map from as Clipboard and Map from key as .pyNote.

In the above example, "abc" is used as boundary separator between each "part". You just need to construct one part for your requirement.

******** Edited by Moderator Marije to add recommended documentation  *********

The above solution is specifically aimed for unsupported multipart/mixed scenario.

The content type "multipart/form-data" should be used for submitting forms that contain files, non-ASCII data, and binary data.

For the latest documentation on implementing a generic use case to send attachment through connect Rest rule please check the following:

File attachment configuration in REST and SOAP integrations

Use case: Send file attachments from a repository

Mapping the data for a POST response for a Connect REST rule

*******************************************************************************************


About Pegasystems

Pegasystems is the leader in cloud software for customer engagement and operational excellence. If you’ve driven a car, used a credit card, called a company for service, opened an account, flown on a plane, submitted a claim, or performed countless other everyday tasks, chances are you’ve interacted with Pega. For the past 30 years, our technology – CRM, digital process automation, robotics, AI, and more – has empowered the world’s leading companies to achieve breakthrough results.