API Node

Updated 

What is an API Node?

An API Node within a dialogue tree assists users in making an API call to an external system.

How to configure an API node

  1. To create a decision box Select API from the dropdown

  2. In the widget, the extension dropdown has a list of pre-made APIs you can choose from.

    • To set up the Input, pick the standard API input value on the left. These will be the inputs to the API.  In the API input, only those values will be shown that have unique values in the API. For example, if the Country field for the Customer Details API always contains ‘India’, it won’t be shown in the drop-down list.Then on the right, enter the parameters you've already set up, corresponding to the API inputs. 

    • Similarly, the Output Values field on the lower left should match the ones present in the API. You can further store these in a corresponding parameter that can be specified under the Output Parameters field.

Lastly, make sure there are no spaces in any of the parameters.

3. Exception Variable will store whether the API has run successfully or not. If the API has timed out and won’t return any values, it will be stored in the variable ‘flightAPIflag’ in this case. This may be useful during debugging or reporting.

4. The Full API Response Variable will store the entirety of the response from the API in string format. This can be accessed further down the dialogue tree to make decisions, store information, or to analyze during debugging. In this case, the variable flightResp will store the entire API response.

5. An Auto Response can be designed for when the API times out. The Threshold for API Timeout can also be input by the user. In our example, the API timeout threshold is set to 15 seconds. The Auto Response can be a generic version of a phrase asking the customer to try again later.