How do I create and publish a Twilio bot?

A. Create a Microsoft Bot:


If you do not have a Microsoft account, go to https://login.live.com/ and sign up.


1. Go to https://dev.botframework.com/ -> click on register a bot -> create an account.
Image 575

2. Fill in the necessary details - Name, Bot handle, Description

3. In the configuration section -> message endpoint will be https://prod-bot-mediation-layer.onsequel.com/slack/bots/botId (botID is "Bot handle")


4. Click on "Create Microsoft App ID and password" button


Image 671



5. Click on "Generate an app password to continue" button. Note down this App Password as shown in the below screenshot for future reference which is required to publish your bot


Image 577


Image 578



6. The App ID and Password are now generated and saved as shown in the below screenshot


Image 579


7. Click on "Finish and go back to Bot Framework" button.

Note down the App ID for future reference which is required to publish your bot


8.Click on "Register" button and your Bot is created


Image 672




Creating a Twilio Account


1. In your Botframework under "Add another Channel" section, click on "Add" for Twilio (SMS) channel


Image 673



2. You are now redirected to Configure SMS section


Image 674



3. Choose the first option to create a Twilio account. Click the URL


Image 675



4. If you do not have a Twilio account, Sign Up for FREE


Image 676



5. Verify your account via SMS


Image 681



6. You are now redirected to Console dashboard. Click Get Started


Image 682


Image 684



7. If you already have a Twilio account, Log in


Image 677



8. You will now be redirected to Console dashboard


Make note of the ACCOUNT SID and AUTH TOKEN for future reference which will be used to publish your bot


Image 679



9. Select # which will take you to Twilio phone number


10. Click on "Get your first Twilio phone number" button


Image 685



11. Your first Twilio phone number is generated

- Click "Choose this Number" if you want to keep this number

- Click the link "Search for a different number" if you want a different twilio phone number


Image 686



12. Your new Twilio phone number is now activated


Image 687



13. Now, go back to Configure SMS window and choose the next option to create a TwiML Application. Click the URl as shown in the below screenshot


Image 688



14. Fill in the Friendly Name


15. In "Messaging" type in the Request URL as https://sms.botframework.com/api/sms


Image 690



16. Your TwiML Application is now created


Image 691



17. Now, go back to Configure SMS window and choose the next option to add your Twilio phone number to TwiML application. Click the URL as shown in the below screenshot


Image 692



18. You are now redirected to Conole dashoard --> Phone numbers section. Click on the Twilio phone number


Image 693



19. Choose"Configure" under Manage Numbers section and scroll down the page


Image 694



20. Choose the following options in Messaging

a) CONFIGURE WITH as TwiML App

b) TWIML APP --> select the Application which you've created earlier (Friendly Name


Save changes


Image 695



21. Now, go back to Configure SMS window and submit the required details


Image 697



22. Fill in the details - Phone number, Account SID, Auth Token and click "Submit Twilio Credentials"


Image 698



23. Once the credentials are verified, click "I'm done configuring SMS"


Image 699



24. Go back to botframework window and edit the Messaging endpoint URL from https://prod-bot-mediation-layer.onsequel.com/twilio/bots/botId to https://prod-bot-mediation-layer.onsequel.com/twilio/bots/phonenumber


- In this example, the phone number is 4692426489. Make sure to prefix it with "+1"

- The URL in this example will be https://prod-bot-mediation-layer.onsequel.com/twilio/bots/+14692426489


Save the changes


Image 700



Your Twilio account is all set and ready to be published



Publish your bot on Twilio


1. When you are ready to publish your bot at www.onsequel.com, choose "Slack" in the platform as shown in the below screenshot

2. Fill in the required details and click on "Publish"

a) Twilio Bot Phone Number

b) Twilio Account SID

c) Twilio Auth Token

d) Microsoft App ID

e) Microsoft App Password


Image 701



Yay! Your bot is now LIVE on Twilio!


Send a message to your Twilio Phone Number to start the chat!

Is this article helpful for you?