DataMap
DataMap builds SWAIG function definitions that execute REST API calls directly on SignalWire’s infrastructure — no webhook endpoint required on your server. This reduces latency, simplifies deployment, and is ideal for straightforward API-to-response integrations.
Use DataMap when you need to call an external REST API and format the response with simple variable substitution. For complex business logic, database access, or multi-step processing, use a standard SWAIG function with a handler instead.
See SwaigFunction for
handler-based tool definitions, and
FunctionResult for the
response builder used in DataMap outputs.
DataMap generates a SWML data_map object
within a SWAIG function definition. See the
SWML data_map reference for the
full specification.
Properties
functionName
Name of the SWAIG function this DataMap will create.
Variable Substitution Patterns
What a template can read depends on where it is. A webhook’s url and params,
the top-level expressions, and the fallback output read the call data, where an
argument is ${args.city}. A webhook’s output, expressions, and foreach read
that webhook’s response instead: a JSON object’s fields from the root (${temp}),
a JSON array under array (${array[0].joke}), and the call data under input,
so an argument there is ${input.args.city}; ${args.city} expands to nothing.
Header values are sent as written, with no templates expanded.
Modifiers are applied right-to-left: ${enc:lc:args.param} lowercases first,
then URL-encodes.