There are a lot of messengers in the world. Connect each one of them and maintain every connection is a very complex job. Luckily a Microsoft already did most of the job for us and provide us with Azure Bot Channel Registration - a web service to connect your chatbot to major messenger platforms. It's free for almost every channel except web-chat and for web-chat, it's free for 10000 messages per month.
API.chat engine is fully compatible with Bot Framework, so you can use Bot Channel Registration to connect 15+ messengers to your API.chat chatbot. Here how you can do it.
Create API.chat chatbot
First, you need to create an API.chat chatbot. Here you can check how to do it.
Create an Azure Bot Channel Registration application
Next, you need to create Azure Bot Channel Registration and obtain pair of MicrosoftAppId and MicrosoftAppPassword to use it later.
2. In the left panel, click Create a resource.
3. In the top center search bar, enter bot. From the drop-down list select Bot Channels Registration.
4. Click the Create button.
5. In the Bot Channels Registration form, provide the requested information about your bot as specified in the table below.
6. Leave the Messaging endpoint box empty for now. You'll enter the required URL after deploying the bot.
8. Click Create New.
9. Click the Create App ID in the App Registration Portal link.
10. In the displayed App registration window, click the New registration tab in the upper left.
11. Enter the name of the bot application you are registering.
13. Click the Register button. Once completed, Azure displays the overview page for the application.
14. Copy the Application (client) ID value and save it in a file.
15. In the left panel, click Certificate and secrets.
16. Under Client secrets, click New client secret.
17. Add a description to identify this secret from others you might need to create for this app.
18. Set Expires to your choosing.
19. Click Add.
20. Copy the client secret and save it to a file. Make sure to keep the file in a secure place.
21. Go back to the Bot Channel Registration window and copy the App ID and the Client secret in the Microsoft App ID and Password boxes, respectively.
22. Click OK.
23. Click the Create button and wait for the resource to be created. It will show in your resources list.
Create (connect) API.chat Universal Channel
Use Universal channel POST endpoint to create universal channel and connect your chatbot to the Bot Channel.
As a result you will get a JSON with webhook url to set as Messaging endpoint
Set this webhook on Configuration under Bot Management of your Bot Registration
Connect a Bot Channel to channels
Now you can connect actual messengers to your bot channel
- Sign in to the Azure Portal.
- Select the bot that you want to configure.
- In the Bot Service blade, click Channels under Bot Management.
- Click the icon of the channel you want to add to your bot.
After you've configured the channel, users on that channel can start using your bot.