GetExternalContactAction query string builder dropping callerId variable

GetExternalContactAction keeps returning an empty set when trying to lookup by phone number. External system has the record but query string builder isn’t appending callerId right. Checked the data type mapping, it’s string, yet request hits endpoint with a blank value. Here’s the action config causing the issue.

{
 "actionType": "GetExternalContactAction",
 "settings": {
 "url": "https://api.crm.internal/lookup?phone={callerId}",
 "method": "GET"
 }
}

Ran this exact setup yesterday while wiring up a dashboard fetch. The inline placeholder syntax gets stripped if the variable isn’t explicitly declared in the action’s queryParameters array. Architect’s builder ignores unregistered tokens. Weirdly enough, the builder doesn’t throw a validation error upfront.

Tried passing it directly in the URL string first. It failed with a 400 bad request on the external endpoint. Swapped to the structured format and the request finally routed.

{
 "actionType": "GetExternalContactAction",
 "settings": {
 "url": "https://api.crm.internal/lookup",
 "queryParameters": [
 {
 "name": "phone",
 "value": "{{callerId}}"
 }
 ]
 }
}

Make sure the callerId output is actually populated from the prior routing step. You’ll also need the externalcontacts:read scope on the service account token, otherwise the platform won’t hydrate the value before sending. The PureCloudPlatformClientV2 wrapper handles the OAuth refresh automatically, but manual HttpClient calls often miss that step. Check the /api/v2/architect/actions logs for the exact variable mapping failure.

{
 "actionType": "GetExternalContactAction",
 "settings": {
 "url": "https://api.crm.internal/lookup",
 "queryParameters": [
 {
 "name": "phone",
 "value": "{{ callerId }}"
 }
 ]
 }
}

Problem

You’re hitting the classic Architect parser trap. The inline URL token syntax gets stripped if the variable isn’t explicitly declared in the action’s queryParameters array. The builder ignores unregistered tokens without throwing a validation error upfront. The suggestion above is spot on about switching to the structured format.

Error

The platform returns a 404 on the external service because the query string arrives completely empty. You’ll see the trace log show a bare GET /lookup request. It’s not a network timeout, it’s a payload stripping issue. Painful debugging session when the logs don’t scream at you.

Question

Check the bot flow versioning history. Recent NLU model updates reset the variable scope and break these mappings overnight.

That queryParameters fix nails the routing issue. Parser still enforces strict double-brace wrapping for runtime tokens though. Step one: verify the variable exists in the flow context. Step two: match the scope to the trigger. Builder just drops the placeholder if it doesn’t line up. It’s a silent fail. Check the execution trace.

The builder drops callerId when the scope mismatches. You’ll need to force the mapping explicitly. Try this:

{
 "actionType": "GetExternalContactAction",
 "settings": {
 "url": "https://api.crm.internal/lookup",
 "queryParameters": [
 { "name": "phone", "value": "{{ callerId }}" }
 ],
 "httpMethod": "GET"
 }
}

Cross-check the outbound request against /api/v2/analytics/flowlogs via platformClient using analytics:flowlogs:view. Verify the variable actually populates. Which trigger scope are you pulling it from?