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 | appid | Enter 'appid' received from subscription |

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. 
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".