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.