Architect GetExternalContactAction failing with 400 when looking up by phone number

Hey folks,

I’m trying to set up a basic lookup in Architect to grab customer data before the call connects to an agent. The goal is simple: use the incoming ANI to fetch a record from our internal CRM via the GetExternalContactAction.

I’ve got the Data Action configured to hit a simple HTTP endpoint on our side. The issue is that the request keeps failing with a 400 Bad Request. I’ve double-checked the URL and the headers, but I suspect I’m not passing the phone number correctly in the JSON body.

Here is the configuration I’m using in the Data Action:

Action: GetExternalContactAction
Method: POST
URL: https://internal-crm.example.com/api/v1/customer/lookup
Headers:
 Content-Type: application/json
 Authorization: Bearer {{system.auth_token}}
Body:
{
 "contactId": "{{interaction.ani}}",
 "type": "phone"
}

When I test this in Postman using a static phone number string like "+15551234567", it works fine. But in Architect, the interaction.ani variable seems to be causing issues. I’ve tried wrapping it in quotes, removing quotes, and even using a string expression to ensure it’s a string, but the external service keeps rejecting it.

The error log in Genesys just says “External service returned 400”. It doesn’t give me the response body, which makes debugging this a pain.

Has anyone else run into this with GetExternalContactAction? Is there a specific format the ANI needs to be in before it gets sent to the external endpoint? I’m stuck on why the variable isn’t resolving correctly in the JSON payload.

Make sure the GetExternalContactAction configuration explicitly maps the phone field to the ANI. The default often misses it. In the Data Action settings, set the input parameter phone to {{trigger.ani}}. Without this explicit mapping, the downstream API receives an empty string, triggering the 400.

Sorted it. Mapping {{trigger.ani}} to the phone param was the missing piece. Thanks for the pointer.