serviceBridge.call() API that works identically across script steps, event subscriptions, and selection option formulas.
The serviceBridge.call() API
Return value: The parsed JSON response body from the external API. If the external API returns a null or empty response, the result is
null. If the call fails due to a network error, misconfiguration, or timeout, a JavaScript exception is thrown. Use a try/catch block or check the return value.
Example:
How It Works
When a script callsserviceBridge.call(), the request is proxied through the Kodexa API. The API resolves the bridge slug, injects authentication headers configured on the bridge, and forwards the request to the external endpoint. The response flows back to the script as a parsed JSON object.
The key security benefit: secrets never leave the server. Bridge credentials are injected by the API proxy layer, not by the script runtime.
The proxy endpoint used internally is POST /api/service-bridges/{id}/proxy/{endpointName}.
Limits and Timeouts
Calls count toward the script’s overall execution timeout.
Examples
Lookup data for a dropdown
Use a service bridge in a selection option formula to populate dynamic choices:Validate against an external system
Use a service bridge in an event subscription to validate data as it changes:Enrich data in a script step
Call an external system to pull in related data during document processing:Error Handling
Service bridge calls can fail in two ways: the call itself fails (throwing a JavaScript exception), or the external API returns a null/empty response. Handle both cases:Setting Up Service Bridges
Service bridges are project resources with endpoint, authentication, and caching configuration. Configure them through the platform UI or resource files for the target project.
