Legacy Dev Forum Posts

 View Only

Sign Up

Getting Error for Developer Tools Query to fetch WrapUpCode Id

  • 1.  Getting Error for Developer Tools Query to fetch WrapUpCode Id

    Posted 06-05-2025 18:44

    Dhiraj_Gudipaly | 2023-02-28 11:42:56 UTC | #1

    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": [] }


    Jason_Mathison | 2023-02-28 13:04:00 UTC | #2

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

    --Jason


    Dhiraj_Gudipaly | 2023-02-28 13:16:45 UTC | #3

    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 ":"


    Jason_Mathison | 2023-03-01 02:20:35 UTC | #4

    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.


    Dhiraj_Gudipaly | 2023-03-01 10:27:16 UTC | #5

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


    Jason_Mathison | 2023-03-01 13:44:46 UTC | #6

    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


    system | 2023-04-01 13:44:53 UTC | #7

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


    This post was migrated from the old Developer Forum.

    ref: 18631