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