Getting Error for Developer Tools Query to fetch WrapUpCode Id

Hi,

I am getting an unusual error for a query code which is working fine in Developer Tools but when I am trying to retrieve the same information in a data action I am getting error in success template.

Query/Request :
{
"interval": "2023-02-25T18:30:00.000Z/2023-03-27T18:30:00.000Z",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 25,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "ani",
"operator": "matches",
"value": "tel:+26876642715"
},
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "voice"
},
{
"type": "dimension",
"dimension": "purpose",
"operator": "matches",
"value": "agent"
}
]
}
]
}

Response:
{
"translationMap": {
"WrapUpCodeID": "$.conversations[0].participants[?(@.purpose=='agent')].sessions[*].segments[?(@.segmentType=='wrapup')].wrapUpCode",
"InteractionID": "$.conversations[0].conversationId"
},
"translationMapDefaults": {
"WrapUpCodeID": "",
"InteractionID": ""
},
"successTemplate": "{\n "WrapUpCodeID":${WrapUpCodeID}\n "InteractionID":${InteractionID}\n}"
}

Error:

{
"message": "Transform failed to process result using 'successTemplate' template due to error:'Unexpected character (':' (code 58)): was expecting comma to separate Object entries\n at [Source: (String)"{\n "WrapUpCodeID":\n "InteractionID":\n}"; line: 3, column: 18]'\n Template:'{\n "WrapUpCodeID":${WrapUpCodeID}\n "InteractionID":${InteractionID}\n}'.",
"code": "bad.request",
"status": 400,
"messageParams": {},
"contextId": "42703855-eded-4bcb-9248-07d685b380ae",
"details": [
{
"errorCode": "ACTION.PROCESSING"
}
],
"errors": []
}

Hi Dhiraj_Gudipaly,
You need a comma between the WrapUpCodeId and the InteractionID.

--Jason

Hi Jason

I tried that, but then it was giving error for that comma. Thats the reason I removed it so now it's giving me error for ":"

Can you provide an example of the response that you are trying to process? Feel free redact anything sensitive, but make sure that the "shape" of the response stays the same.

It should look something like this =
wrapUpCode: 70d39439-a9d9-462c-81c0-492ceb7928c5

Could you run your action in test mode, and grab the results of the "Execute" step, redacting anything sensitive? It is hard to troubleshoot issues without having the exact response you are dealing with.

--Jason

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.