Running into this invalid JSON
error when I try to use my decision model to send offer data to be used in the experience. I've tested the decision model in test canvas and see that the offer is returned as an output of decisionModelResultNodes
. I then copy this "kitchen-sink" freemarker snippet into the API tab that I found in the CDP
tool that is recommended for capturing decision offers:
{
<#if (decisionModelResults)??>
"decisionValues": [
<#if (decisionModelResults.decisionModelResultNodes)??>
<#list decisionModelResults.decisionModelResultNodes as result>
<#if (result.outputs)??>
<#list result.outputs as output>
<#list output as outputName, outputValue>
<#if (!outputValue?is_hash) && outputName != "ruleId">
{
"decisionType": "${result.type}",
"trackingUrl" : "${createContentTrackingURL('myContentID')}",
"decisionName" : "${result.name}",
"outputName" : "${outputName}",
"outputValue" : "${outputValue}"
}<#if output_has_next>,</#if>
</#if>
</#list>
</#list>
<#if result_has_next>
<#if decisionModelResults.decisionModelResultNodes[result?index + 1].outputs?size != 0>,</#if>
</#if>
</#if>
</#list>
</#if>
],
</#if>
<#if (offers)??>
"decisionOffers": ${toJSON(offers)},
</#if>
"guest": {}
}
With this, I get API response must be valid JSON
error, but the response they show me looks like valid JSON
, and the decision model returns an offer in the test canvas so I'm not sure what I can do.