Perform Web Service Calls From Within an Interview

Developers can securely call out to a third party service from within an interview using interview extensions. Examples of where this may be helpful include:

  • Passing to an external timetabling system for appointment booking
  • Performing background or identity checks, for example, when applying for a gun license or security clearance
  • Loading a list of values from an external system into a drop-down list

This is done by defining an interview extension data connection in Intelligent Advisor Hub and then invoking the connection from a JavaScript interview extension using the interview.fetch() method. Data from the fetch method call is passed to the Intelligent Advisor server.

These steps are detailed below:

  1. Identify or create a web service.
  2. Create a connection for use by an interview extension.
  3. Integrate the connection via an interview extension. To do this, in your JavaScript file you need to:
    1. Define the properties for the options object that will be provided to the fetch() method. For more information, see Properties for the fetch method.
    2. Call the interview.fetch method. For more information, see The interview object methods.
    3. Process the results as needed.
  4. Test if the web service call is working by deploying and activating the Policy Modeling project and launching the interview.

Tip: A worked example of performing a web service call from within an interview is shown in Example: Display a Business Name Fetched During the Interview.

Although this connection can be used to send session data, attachments, signatures and generated forms are not available to be retrieved by the extension framework.