Genesys Cloud CX

 View Only
Discussion Thread View
  • 1.  Data Action using External Contact Reverselookup API : If a field is blank.

    GENESYS
    Posted 02-16-2018 14:31

    Hi Everyone,

    So I finally created a data action that uses the purecloud api to do a reverse lookup and add the information into the agent script. The issue I've run into is that if the external contact field I'm pulling is empty it fails (let's say the customer gave us a cell# but not a work#). So how do I code my response in the data action to return any results even if it's blank or null?

    Run Test Results:

    {

    "status": 400,

    "code": "invalid.extraction.into.translation.map",

    "message": "There was an issue extracting a value from the remote endpoint's response into the response translation map. Cause: Missing property in path $['contacts'][0]['cellPhone']",

    "messageParams": {},

    "contextId": "53dc3621-9156-4db4-86e2-6cf558e918a9",

    "details": [],

    "errors": []

    }

     

    Response Section:

    {

     "translationMap": {

      "firstName": "$.contacts[0].firstName",

      "lastName": "$.contacts[0].lastName",

      "title": "$.contacts[0].title",

      "workPhone": "$.contacts[0].workPhone.e164",

      "cellPhone": "$.contacts[0].cellPhone.e164",

      "homePhone": "$.contacts[0].homePhone.e164",

      "otherPhone": "$.contacts[0].otherPhone.e164",

      "workEmail": "$.contacts[0].workEmail",

      "personalEmail": "$.contacts[0].personalEmail",

      "otherEmail": "$.contacts[0].otherEmail",

      "address1": "$.contacts[0].address.address1",

      "address2": "$.contacts[0].address.address2",

      "city": "$.contacts[0].address.city",

      "state": "$.contacts[0].address.state",

      "postalCode": "$.contacts[0].address.postalCode",

      "countryCode": "$.contacts[0].address.countryCode"

     },

     "successTemplate": "{\"firstName\": ${firstName}, \"lastName\": ${lastName}, \"title\": ${title}, \"workPhone\": ${workPhone}, \"cellPhone\": ${cellPhone}, \"homePhone\": ${homePhone}, \"otherPhone\": ${otherPhone}, \"workEmail\": ${workEmail}, \"personalEmail\": ${personalEmail}, \"otherEmail\": ${otherEmail}, \"address1\": ${address1}, \"address2\": ${address2}, \"city\": ${city}, \"state\": ${state}, \"postalCode\": ${postalCode}, \"countryCode\": ${countryCode}}"

    }

     

     



  • 2.  RE: Data Action using External Contact Reverselookup API : If a field is blank.

    GENESYS
    Posted 02-16-2018 17:08

    Hi Jonathan,

     

    The most reliable audience for API talk lives in the Developer forum. If you don't find what you need here, I'd suggest giving the Developer forum a go. Those folks live and breathe APIs.

     

    Here's a link:

    https://developer.mypurecloud.com/forum/

     

    Thank you!

    Clay



  • 3.  RE: Data Action using External Contact Reverselookup API : If a field is blank.

    GENESYS
    Posted 02-16-2018 17:31
    Thanks Clay, Yeah I seem to run into this loop of community vs. developer forum frequently. I wish there was a way to tag both, without re-writing a new post.


  • 4.  RE: Data Action using External Contact Reverselookup API : If a field is blank.

    GENESYS
    Posted 02-16-2018 17:34

    I completely understand. We're actually working on a project right now to consolidate our customer communities onto one site. I'm hoping that we can incorporate the Developer Forum also one day. I'll use your comment as a good argument for the same.

     

    Have a great weekend!