Genesys: Troubleshooting Web Service Data Actions
When creating Web Service Data Actions (and their dependent flows) in Genesys I spent a lot of time debugging problems around these Data Actions - the main culprit being input values that resulted in unexpected responses from a downstream API, breaking contracts/mappings. The following is how I sped up diagnosing problems by spying on the interaction between my Web Service Data Actions and downstream APIs.
WARNING: The tool used below should never be used to spy on Data Actions that are used by real customers. It terminates after a fixed period of time, has limited bandwidth and may leak secrets.
We will intercept a Data Action’s requests by configuring the Data Action to point at a tunnel created by a tool called ngrok. This tunnel will forward requests to the Data Action’s original URL, and importantly will allow us to inspect any request that passes through it.
Creating the tunnel will require ngrok to be installed locally by following the steps:
- Follow the official instructions to install ngrok
- Sign up for a free account. You’ll need this to be able to configure the proxy
- Configure ngrok with an auth token from the account you set up above
Creating a tunnel
Create the tunnel by running the following command, configured with the host from the Data Action’s URL
ngrok http -host-header=<host> <host>:<port>
-host-header=<host>- Set the host-header switch to the host of the Data Action’s current URL
<host>:<port>- Set this to the host and port of the Data Action’s current URL
If the Data Action’s URL is
Then the command will be:
ngrok http -host-header=example.com example.com:443
Port 443 = HTTPS
Configuring the Data Action
When you run the ngrok command in the previous step you’ll be presented with the output below. Contained within this output is the randomly generated forwarding address. We will configure our Data Action to use this URL.
ngrok by @inconshreveable (Ctrl+C to quit) Session Status online Account firstname.lastname@example.org (Plan: Free) Version 2.3.35 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding https://12abc-12abc-12abc.ngrok.io -> https://example.com:443 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00
Update the Data Action’s URL
- Take the forwarding address from output, which in the example above is:
- Update the Request URL Template in the Data Action to use the forwarding address:
Now ngrok is running and your Data Action is pointing at ngrok’s forwarding address (aka tunnel) you can inspect HTTP(S) traffic going through it.
When you close ngrok it will also close the tunnel (which is unique each time), so you’ll have to revert your Data Action’s URL after inspecting the traffic.