Customizing Interaction API Response | Community
Skip to main content
Level 6
May 12, 2021
Question

Customizing Interaction API Response

  • May 12, 2021
  • 3 replies
  • 1350 views

Hello Folks,

We have a requirement to use OOTB Interaction API for Proposing Offers to the Inbound Communications. However there is a bit of customization required here, wherein we have to include few additional fields in the offer proposition that is returned back as response.

These fields are of 2 types:

i. Fields passed in the initial request to Offer Engine and ii. Custom fields defined and derived in Campaign

Below is how a sample request look like and response we are expecting:

Request:

<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:nms:interaction">
<soapenv:Header/>
<soapenv:Body>
<urn:Propose>
<urn:sessiontoken></urn:sessiontoken>
<urn:targetId>491084906</urn:targetId>
<urn:maxCount>1</urn:maxCount>
<urn:categories></urn:categories>
<urn:context>
<context>
<interaction>
<inbound>true</inbound>
<productId>P1001</productId>
<productName>Cricket Kit</productName>
<productCategory>Sport</productCategory>
<transaction account="4193146737" amount="102.00"/>
</interaction>
</context>
</urn:context>
</urn:Propose>
</soapenv:Body>
</soapenv:Envelope>

Response:

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://xml.apache.org/xml-soap" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ProposeResponse xmlns="urn:nms:interaction">
<interactionId xsi:type="xsd:string">0</interactionId>
<propositions xsi:type="ns:Element" SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
<propositions>
<proposition id="a617303" offer-id="535003" offerSpace-id="535243" weight="1" rank="1">
<view>
<textSource>Dear Customer, Thanks for making purchase with us!</textSource>
<!-- Rest of the fields from offer content will be present here -->
</view>
<!-- Custom Fields -->
<productId>P1001</productId> <!-- Passed in the Initial Request -->
<isCustomerNew>Yes</isCustomerNew> <!-- Defined and Derived from Campaign -->
</proposition>
</propositions>
</propositions>
</ProposeResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I have tried adding custom fields by overriding XML Rendering Function, explored some options available in Integrating Server-side and tried adding under Offer Space definition. But still missing some clarity in this process. So would request you to please help with some inputs on how we can implement this in a feasible way.

Thanks,

Sri Bhargav

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Level 6
May 14, 2021
Hi Folks, Any pointers on how can we do this ? Please help
Level 6
May 17, 2021
Hi Folks, Any suggestions on this query please?
Level 6
May 17, 2021

@jonathon_wodnicki , @adhiyan , @amit_kumar , @sukrity_wadhwa 

Folks, Any suggestions on this query

Thanks,