Information
This documentation supports the 21.3 version of BMC Helix Virtual Agent, which is available only to BMC Helix customers (SaaS).To view an earlier version, select the version from the Product version menu.

Exercise 1 - Configure the Weather service Web API


Pre-requisite:
 Before configuring the Web-API make sure that the Chatbot Starter Kit content package is imported successfully. From Innovation Studio, click the following tabs and look for the following content:


    • Document - Open Weather Current Weather
    • WEB APIs - Open Weather API
    • Process - Get Weather

If the content is present then proceed to the next step below, otherwise you need to install the Chatbot Starter Kit first using the instructions found within this guide.
Subscribe to get Open Weather appid:
 A free version of the Open Weather subscription is enough to get this example use case running. Subscribe to the free version https://openweathermap.org/appid and note the 'appid' key received. Calling their Open Weather API is authenticated using the appid.
Test the API using the appid received after subscription using the browser. You should receive a JSON response with temperature and other details. For example, https://api.openweathermap.org/data/2.5/weather?q=Las Vegas&units=imperial&mode=json&appid=your app Id
In the URL above, q units and mode query parameters are passed to the Web-APIs from the Process. Query parameter appid is passed as part of the Web APIs authentication configuration.
Configuring Open Weather Connection:
 From Innovation Studio login as a Tenant Administrator and navigate to the Administration Settings. Select Configure My Server>Connections>Web APIs. This will launch the New Web API Connection dialog. Add the values as shown below and save the connection.

Section

Property Name

Value

General

Name

Open Weather Connection

 

Host Name

api.openweathermap.org

 

Port

443

 

Protocol

HTTPS

 

Authentication

Custom

Authentication
Add Query Param

appid

Enter 'appid' received from subscription


worddave8f6e76769cd21d5fecfd4f807c98d50.png

Web API Connection Mapping:
 Select Configure My Server>Connections Mappings>Web API
 Select Application as chatbotstarterkit-lib and map the Connection Configuration to Open Weather Connection.
worddav23896a8eb4738f505c770f123a52b66f.png
Now you can test the Bot using the IT Chat Bot workspace. If the specified city name is understood by the open weather API it will respond back with the weather details. Else the Bot will respond with the message; "Weather information for city, '<specified city', is not available".

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Helix Virtual Agent 21.3