Yes, the URL https://optlbot.azurewebsites.net/api/messages works only for POST
request and not a GET
request, because you post a message from user to bot and not a get, you can see that in the MessagesController
code.
Being said that, if you want to test your bot locally, you have to use the emulator. You can have a look at Bot emulator for the same.
Now if you want to publish the bot to the world so that others can see it and use it, so that's where the channel comes in. Consider channel as a medium by which you enable your bot for others to use with a much better user experience.
There are multiple channels available for the bot to be published in, and yes you can publish the same bot in all the channels.webchat is just one channel and the one which is enabled by default and the way to see it is :
- Open your bot in the Azure Portal and click Channels blade.
- Click Edit for the Web Chat channel
- Under Secret keys, click Show for the first key
- Copy the Secret key and the Embed code.
- Click Done
So the embed code is actually an iframe which you can place in your website or share with others who want to use your bot. Or you can use the src
of the iFrame too to reach the bot directly.
Again this is just one channel. You can take a look at the Configure channels documentation for steps to enable the bot in more channels like Skype, Microsoft Teams, Email, Facebook, Slack, Telegram, etc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…