Architect GetExternalContactAction: Phone number lookup returning empty JSON?

Hey folks,

I’m trying to wire up a GetExternalContactAction in CXone Architect to pull customer data before the call hits a queue. The goal is simple: look up the caller’s phone number against our legacy CRM endpoint and grab their account status.

The external contact object is configured to hit https://api.ourcrm.com/v1/customers/lookup. I’ve set the method to GET and the content type to application/json. The tricky part is passing the phone number. I’m using an expression in the URL path:

https://api.ourcrm.com/v1/customers/lookup?phone=${interaction.call.fromNumber}

The endpoint works fine in Postman. If I send ?phone=5551234567, it returns:

{
 "id": 12345,
 "status": "active",
 "tier": "gold"
}

But in Architect, the action completes successfully (no error code), yet the output variables are completely empty. The trace shows the HTTP 200 response came back with the data, but it’s not mapping to the contact fields. I’ve tried mapping the response body directly to a string variable just to see what’s coming in, and it’s null.

Is the fromNumber expression resolving correctly at runtime? Or am I missing a step in how the external contact action parses the JSON response? I’ve checked the field mappings in the external contact definition, but there’s not much to configure there for a raw JSON blob.

Any ideas?

The docs for external contacts are pretty thin on this, but the issue is almost certainly the query string formatting. If you’re passing the phone number as a path variable in the URL template, Architect expects the variable to be resolved before the HTTP request fires.

Check your URL template. It should look like https://api.ourcrm.com/v1/customers/lookup?phone={{trigger.callee.phoneNumber}} if the endpoint expects a query param, or https://api.ourcrm.com/v1/customers/lookup/{{trigger.callee.phoneNumber}} if it’s a path param. If you’re hardcoding the value in the “Test” tab and it works, that’s a red herring. The runtime context often strips out formatting characters like + or spaces from the phone number variable before it hits the template.

Try logging the {{trigger.callee.phoneNumber}} to a text file right before the GetExternalContactAction. You’ll likely see it’s being passed as 61412345678 instead of +61 412 345 678. Most legacy CRMs choke on the missing country code or the specific format.

Force the format in the flow before the lookup:

<SetVariable name="formatted_phone" value="{{formatPhoneNumber(trigger.callee.phoneNumber, 'E.164')}}" />

Then point your external contact URL to ...lookup?phone={{formatted_phone}}.

Also double check the CRM endpoint isn’t returning a 204 No Content or an empty {} on a cache miss. Architect treats an empty JSON body as a failed lookup and returns null for all mapped fields. You might need to handle the error state in the flow if the CRM doesn’t support the exact E.164 string.

Added the Accept header. Empty response was 404 from the CRM side because it didn’t recognize the request.