Hi all,
Quite a newbie to Data Actions and the way to deal with them in Genesys as well API's in general.
My question is that we query a backend system for customer contracts and depending on the type they can come back as a RunningAccount tree or a FixedTermFixedSum one.
The initiating call for either product is the same with a product line variable that determine the product type:
Input Contract:
{
"title": "Input",
"type": "object",
"properties": {
"agreementid": {"type": "string"}, //This is the customers agreement e.g. 00123498
"custAuthGuid": {"type": "string"}, //Unique token allows temporary access to the data. e.g. 2703680b-2519-4b5b-8b86-9e2367ac403d
"interactionid": {"type": "string"}, //This is the ID of the interaction e.g. 7842b42f-a940-4ae4-a6a6-918edba68b40
"shopCode": {"type": "string"}, //Identifies the shop. e.g. 9802
"clientCode": {"type": "string"}, //Identifies the customer e.g. LX5
"productLine": {"type": "string"} //Either RunningAccount or FixedTermFixedSum
},
"additionalProperties": true
}
The Output looks like this For FixedTermFixedSum:
{
"title": "Output",
"type": "object",
"properties": {
"agreementId": {"type": "string"},
"motorData": null,
"runningAccountData": null,
"ipfData": null,
"fixedTermFixedSumData": {
"type": "object",
"properties": {
"financialData": {
"hasThirdPartyAccess": {"type": "boolean"},
"agreementCount": {"type": "Integer"},
// MANY VARIABLES AND ARRAYS
"creditProductType": {"type": "string"},
"creditProductTypeDescription": {"type": "string"}
},
"additionalProperties": true
},
},
"purchasedItems": {
"type": "array",
"items": {
"title": "purchasedItems",
"type": "object",
"properties": {
"skuCode": {"type": "string"},
"productDescription": {"type": "string"},
"make": {"type": "string"},
"model": {"type": "string"},
"quantity": {"type": "integer"},
"totalPrice": {"type": "integer"}
},
"additionalProperties": true
}
},
"cardsData": null
}
}
For RunningAccount the returned data looks like this:
{
"title": "Output",
"type": "object",
"properties": {
"agreementId": {"type": "string"},
"runningAccountData": {
"type": "object",
"properties": {
financialData": {
"type": "object",
"properties": {
"hasThirdPartyAccess": {"type": "boolean"},
"agreementCount": {"type": "integer"},
// MANY VARIABLES AND ARRAYS
"creditProductType": {"type": "string"},
"creditProductTypeDescription": {"type": "string"}
},
"additionalProperties": true
},
},
},
"purchasedItems": []
},
"ipfData": null,
"fixedTermFixedSumData": null,
"cardsData": null
}
How do I create a translation map
{
"translationMap": {
"has3rdPartyAccess": "$.fixedTermFixedSumData.financialData.hasThirdPartyAccess",
"agreementCount": "$.fixedTermFixedSumData.financialData.agreementCount",
"creditProductType": "$.fixedTermFixedSumData.financialData.creditProductType",
"creditProductTypeDescription": "$.fixedTermFixedSumData.financialData.creditProductTypeDescription"
},
-- OR --
"translationMap": {
"has3rdPartyAccess": "$.runningAccountData.financialData.hasThirdPartyAccess",
"agreementCount": "$.runningAccountData.financialData.agreementCount",
"creditProductType": "$.runningAccountData.financialData.creditProductType",
"creditProductTypeDescription": "$.runningAccountData.financialData.creditProductTypeDescription"
},
"translationMapDefaults": {
"has3rdPartyAccess": ""Not Found"",
"agreementCount": ""Not Found"",
"creditProductType": ""Not Found"",
"creditProductTypeDescription": ""Not Found""
},
"successTemplate": "{\n "has3rdPartyAccess": ${has3rdPartyAccess},\n "agreementCount": ${agreementCount}\n "creditProductType": ${creditProductType}\n "creditProductTypeDescription": ${creditProductTypeDescription}\n }"
}