Microsoft Location Control for Microsoft Bot Framework
The Microsoft location control for Microsoft Bot Framework makes the process of collecting and validating the user's desired location in a conversation easy and reliable. The control is available for C# and Node.js and works consistently across all channels supported by Bot Framework.
Use Case and Features
Bots often need the user's location to complete a task. For example, a Taxi bot requires the user's pickup and destination address before requesting a ride. Similarly, a Pizza bot must know the user's delivery address to submit the order, and so on. Normally, bot developers need to use a combination of location or place APIs, and have their bots engage in a multi-turn dialog with users to get their desired location and subsequently validate it. The development steps are usually complicated and error-prone.
The Microsoft location control makes this process easy by abstracting away the tedious coding steps to let the user pick a location and reliably validate it. The control offers the following capabilities:
- Address look up and validation using the REST services of Azure Maps or Bing Maps depending on which APOI key you use in your bot.
- User location returned as strongly-typed object complying with schema.org.
- Address disambiguation when more than one address is found.
- Support for declaring required location fields.
- Support for FB Messenger's location picker GUI dialog.
- Open-source code (C# and Node.js) with customizable dialog strings.
To start using the control, you need to obtain an Azure Maps or Bing Maps API subscription key.
- You can sign up to get a free Azure Maps key with uo to 25,000 transactions a month through Azure. Details are documented here.
- You can sign up to get a free Bing Maps key with up to 10,000 transactions per month in the Azure Marketplace.
The examples show different location selection scenarios supported by the Microsoft location control.
Address selection with single result returned
Address selection with multiple results returned
Address selection with required fields filling
Address selection using FB Messenger's location picker GUI dialog
Read these resources for more information about the Microsoft Bot Framework, Bot Builder SDK and Bing Maps REST Services: