Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Pure Cloud Data Action

    Posted 03-19-2020 10:29
    No replies, thread closed.
    Hello everyone,

    I am accessing custom data from incoming chat interactions via Conversation API (/api/v2/conversations/chats/:conversationId), i am able to access information like name or purpose:

    "translationMap": {
    "name": "$.participants[0].name",
    "purpose": "$.participants[0].purpose"
    }

    Result:

    {
    "purpose": "customer",
    "name": "Alexander"
    }

    But the problem is when I try to access information from attributes:

    "attributes": {
                    "context._genesys_OS": "Windows",
                    "context.email": "amartinez@interaxa.com",
                    "context._genesys_browser": "Chrome",
                    "context.phoneType": "Cell",
                    "context._genesys_referrer": "",
                    "context.nickname": "Alexander",
                    "context.addressStreet": "64472 Brown Street",
                    "context.phoneNumber": "1-916-892-2045 x293",
                    "context._genesys_source": "web",
                    "context.addressPostalCode": "50163-2735",
                    "context.addressCity": "Lindgrenmouth",
                    "context.genesys.legacyRoutingTargetQueueAddress": "",
                    "context.firstName": "Alexander",
                    "scriptId": "26d4ed4a-9a0a-49b3-b0cc-538fb548a4b6",
                    "context.lastName": "Martinez",
                    "context.customerId": "59606",
                    "context.subject": "Prueba",
                    "context._genesys_url": "http://localhost:8080/esenttia/esenttia.html",
                    "context.addressState": "FL",
                    "context._genesys_pageTitle": "PureCloud WebChat Demo",
                    "context.customField1": "My Custom Value"
                }

    If i add in translationMap context.email:

    "translationMap": {
    "name": "$.participants[0].name",
    "purpose": "$.participants[0].purpose",
    "customeremail": "$.participants[0].attributes.context.email"
    }

    Result:

    {
    "message": "Failed while processing the translation map. Could not resolve value for the key: 'customeremail' and no default value was configured. Additional details: Missing property in path $['participants'][0]['attributes']['context']",
    "code": "bad.request",
    "status": 400,
    "messageParams": {},
    "contextId": "44e74635-8ade-4bc8-afc2-1be27c86eaca",
    "details": [
    {
    "errorCode": "ACTION.PROCESSING"
    }
    ],
    "errors": []
    }

    I'd really appreciate any help.

    Thanks
    #Integrations

    ------------------------------
    Alexander Martinez
    Interaxa Colombia S.A.
    ------------------------------


  • 2.  RE: Pure Cloud Data Action
    Best Answer

    Posted 03-21-2020 17:41
    No replies, thread closed.
    Yeah, Data Actions are not the best at embedded JSON objects.  Usually you have to hard code this in the Configuration tab for the response map to retrieve the entire object and then parse there.  I have found the output contracts don't really like these embedded objects and found it easier if you do two calls to the web service so you get the information at the top level.  In other words, look for the first level then query the details of that using a second data action.

    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    robertwc@avtex.com
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 3.  RE: Pure Cloud Data Action

    Posted 03-22-2020 11:24
    No replies, thread closed.
    Hi Robert

    Thanks for your help, i retreived the entire object.

    ------------------------------
    Alexander Martinez
    Interaxa Colombia S.A.
    ------------------------------