Microsoft Healthcare Bot service can be configured to connect to multiple channels. A channel is a connection between the Healthcare Bot and communication apps. The Healthcare Bot leverages Azure Bot Service to connect your bot to a channel and facilitates communication between your bot and the user. The default channels available in Healthcare bot are Web Chat, DirectLine, Microsoft Teams, Twilio and Facebook.
Healthcare Bot is easy to connect with a Web Chat embedded on a web page or connect with Microsoft Teams. Another popular channel is to connect it to an SMS provider for public-facing scenarios. Twilio allows us to establish a connection such that patients can interact with the health bot via a simple text message.
This blog provides step-by-step instructions to connect the Healthcare Bot to Twilio’s SMS service. Steps include:
1. Create a new Twilio account. Requirements to sign up: a valid email address and phone number. It then asks a few questions about how you would like to use Twilio, what kind of developer are you, the kind of project you are working on, and so forth. For sample answer: I chose - Developer, C#, Project, and Send or receive a SMS.
2. You will then be redirected to the project dashboard.
3. Click on ‘Get a Trial Number’. A random number is generated from a pool of trial numbers which might not have your area code, but you can add your final number later.
4. Click on “Choose this Number”. You will have the ability to add your final number later.
5. The Twilio dashboard for Project Info now has the first 3 pieces of information you need – Phone Number, Account SID, and Auth Token. You can click on the double box on the right-hand side to copy values to your clipboard.
1. Login to your health bot admin portal. From the hamburger menu, navigate to Integration -> Channels. Mark the Twilio channel active.
2. You will be prompted for the Phone Number, Account SID, and Auth Token. Enter details you copied in previous step from the Twilio Project Info. Click “Save”.
This step connects the Health Bot to Twilio. Next, we need to setup Twilio to forward messages to Health Bot.
1. The health bot is now listening to messages coming from Twilio, but we still need to forward the messages from Twilio to the health bot. Go back to the Twilio dashboard and select the circle with the ellipses on the menu bar. You can even pin it to keep it on the menu.
2. Select the SMS and Messaging Services. Click “Create new Messaging Service” button.
3. Give it a friendly name, and select the Chat Bot / Interactive 2-way option.
4. Then, you can edit the settings of the Messaging Service, specifically the “Inbound Settings”. Choose the SEND AN INCOMMING_MESSAGE WEBHOOK option and put in the request url in this form: https://sms.botframework.com/api/sms
5. Now, the service is created and settings are configured to send messages to the health bot. Next, we need to associate the Twilio number with the service. To do this, navigate to Numbers section of the configured Health Bot SMS service we just created. Select the Numbers option and Add an Existing Number.
6. Select the trial number and Add Selected
Congratulations, you have successfully completed the configuration and can now try out the new SMS to Health Bot connection!
Please note that the health bot needs to respond to any kind of text and it may not be related to the scenarios outlined on web pages that host the Health bot via Web Chat channel.
Thanks for reading and let us know how we can help.
John Brown, Microsoft Azure Cloud Architect
Nikita Pitliya, Microsoft Data & AI Solution Architect
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.