Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Get agent response time

    Posted 06-05-2025 18:41

    Rafael_Kaufmann | 2019-12-17 15:08:06 UTC | #1

    Hi,

    I want to configure a Data Action which provides the agent response time for a conversation. Unfortunately i get no output with my json qurey. Respective the data Action provides the error message: "Failed while processing the translation map. Could not resolve value for the key: 'tAgentResponseTime' and no default value was configured. Additional details: Missing property in path $['metrics']",

    { "interval": "${input.interval}", "granularity": "P1D", "groupBy": [], "filter": { "type": "or", "predicates": [ { "type": "dimension", "dimension": "conversationId", "operator": "matches", "value": "${input.conversationId}" } ] }, "views": [], "metrics": [ "tAgentResponseTime" ] }


    { "translationMap": { "tAgentResponseTime": "$.metrics[0].tAgentResponseTime" }, "translationMapDefaults": {}, "successTemplate": "{\"tAgentResponseTime\": ${tAgentResponseTime}} " }

    Can somebody maybe help me?

    Thank you! Rafael Kaufmann


    Jason_Mathison | 2019-12-18 13:57:33 UTC | #2

    Hi Rafael,

    Could you export your action and attach it and also include what you are getting back in the "Execute" step of test mode? With those two things it should be possible to reproduce what you are seeing and help you out.

    --Jason


    Jason_Mathison | 2019-12-18 14:49:59 UTC | #3

    One other question, are you able to get the information you are looking for with a tool like the analytics query builder? https://developer.mypurecloud.com/developer-tools/#/analytics-query-builder

    We highly recommend getting the rest request figured out in a dedicated tool like the query builder / salesforce workbench / postman and then create the data action based on a working rest request.


    Rafael_Kaufmann | 2019-12-18 15:18:34 UTC | #4

    <a class="attachment" href="/forum/uploads/db6296/original/2X/d/dad555c1eb6cd90c1d5f50218ba60feb6e6fa19f.json">getagentreponsetime-20191218160655.custom.json</a> (1.6 KB)


    Rafael_Kaufmann | 2019-12-18 15:19:26 UTC | #5

    Hi Jason, Do you mean this information from the execute step:

    1. Validate request body contains simple json (key-value pairs)

    { "interval": "2019-09-24T10:44:40Z/2019-09-24T12:04:36Z", "conversationId": "b5ed8211-9bcb-4b93-92ef-22efdddbf828", "orgId": "2b7b658a-39f8-44d6-bcb3-9b15a619d1b4", "integrationId": "d16d90aa-1e40-444f-a72a-c4c4984d5ef9", "rawRequest": "{\"interval\":\"2019-09-24T10:44:40Z/2019-09-24T12:04:36Z\",\"conversationId\":\"b5ed8211-9bcb-4b93-92ef-22efdddbf828\"}" }

    1. Validate draft definition

    { "success": true }

    1. Validate request body against input schema

    { "success": true }

    1. Perform authentication

    { "success": true }

    1. Resolve request URL template

    "[POST] https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query"

    1. Resolve request header templates

    { "Authorization": [ "<REDACTED>" ], "Content Typ": [ "application/json" ] }

    1. Resolve request body template

    "{\n \"interval\": \"2019-09-24T10:44:40Z/2019-09-24T12:04:36Z\",\n \"granularity\": \"P1D\",\n \"groupBy\": [],\n \"filter\": {\n \"type\": \"or\",\n \"predicates\": [\n {\n \"type\": \"dimension\",\n \"dimension\": \"conversationId\",\n \"operator\": \"matches\",\n \"value\": \"b5ed8211-9bcb-4b93-92ef-22efdddbf828\"\n }\n ]\n },\n \"views\": [],\n \"metrics\": [\n \"tAgentResponseTime\"\n ]\n}"

    1. Execute

    {}

    1. Resolve translation map

    { "status": 400, "code": "bad.request", "message": "Failed while processing the translation map. Could not resolve value for the key: 'tAgentResponseTime' and no default value was configured. Additional details: Missing property in path $['metrics']", "messageParams": {}, "contextId": "fa24af31-2bda-49d5-b6b6-f41057686eec", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [] }


    Rafael_Kaufmann | 2019-12-18 15:20:17 UTC | #6

    I used the query builder but i just get a blank response


    Jason_Mathison | 2019-12-18 15:36:44 UTC | #7

    Ok, so you currently don't have a working query. I suggest taking a look at the "Analytics and Reporting" room to see if anyone has done this, and if not post your work in progress there. Once you have a working query it should be easy to get your data action working.


    Rafael_Kaufmann | 2019-12-18 15:42:58 UTC | #8

    Okey I will try. Thank you for your support!


    system | 2020-01-18 15:43:02 UTC | #9

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