Hello guys,
I want to obtain the metric tAbandon for a interaction using data action and I am stuck. Can you please enlighten me cause no matter what I use as output contract, I never get it to work.
Input Contracts:
{
"title": "input",
"type": "object",
"properties": {
"ConversationID": {
"type": "string"
}
},
"additionalProperties": true
}
Output contracts:
{
"title": "output",
"type": "object",
"properties": {
"tAbandon": {
"type": "number"
}
},
"additionalProperties": true
}
Request:
{
"requestUrlTemplate": "/api/v2/analytics/conversations/details?${input.ConversationID}",
"requestType": "GET",
"headers": {
"content-type": "application/json"
},
"requestTemplate": "${input.rawRequest}"
}
Response:
{
"translationMap": {
"tAbandon": "$.conversations[0].participants[?(@.purpose == 'acd')].sessions[0].metrics[?(@.name == 'tAbandon')].value"
},
"translationMapDefaults": {
"tAbandon": ""Not Found""
},
"successTemplate": "{"tAbandon": ${tAbandon}}"
}
I get the below error:
{
"message": "JSON failed output schema validation for the following reasons: Schema: # @/properties/tAbandon. Error location: /tAbandon. instance type (array) does not match any allowed primitive type (allowed: ["integer","number"])",
"code": "invalid.schema",
"status": 400,
"messageParams": {},
"contextId": "89cffdd8-a5e8-441d-961e-5f53ac126d91",
"details": [
{
"errorCode": "ACTION.PROCESSING"
}
],
"errors": []
}