This node.js example connector allows you to make your Teneo bot available using the Microsoft Bot Framework, allowing you to target channels like Skype, Microsoft Teams and Cortana. The connector acts as middleware between the Microsoft Bot Framework and Teneo. This guide will take you through the steps of registering a new Microsoft bot app and deploying the connector and make it available via Skype.
You can find the source code of this connector on Github.
The Microsoft Bot Framework requires that the connector is available via https. On this page we will be using Heroku to host this connector, for which a (free) Heroku account is needed. You can however also manually install the connector on a location of your choice, see Running the connector locally.
Your bot needs to be published and you need to know the engine url.
Create an app in Microsoft's Application Registration Portal
Before we can deploy our connector, we need an 'Application Id' and 'Application password' from Microsoft. To obtain those, we need to create an app in Microsoft's Application Registration Portal.
A new window will appear, use its search function 'Search the Marketplace' and search for 'Bot Channels Registration'
Click 'Create' in the new 'Bot Channels Registration' window
Depending on your Azure account, you may need to click 'Start free' and once your subscription is done, you can proceed with setting up the bot
Setting up the bot
Give the bot a name, this name will be available on Skype etc.
Provide the details for the Subscription, Resource Group (If you don't have one, create a new one), and Location
Depending on your Azure account you may need to specify a 'Pricing Tier'. You can choose the free tier 'F0 (10K Premium Messages)' during development.
Enter the following URL in the Messaging Endpoint field: https://[yourherokuappname].herokuapp.com/api/messages (replace [yourherokuappname] with the name of your app on Heroku).
Click on 'Auto create App ID and password' and in the 'blade' that appears click 'Create new' and in the next blade that appears enter your Application Id and Application Password and click 'Ok'.
Click 'Create' in the first blade to create your bot. You will be notified when the bot is available.
That's it! You can now test your bot by opening your bot resource by clicking on 'All resources' on the left then select your bot. Under Bot management select 'Test in Web chat'.
Add a channel
You can make your bot available on various channels by opening your bot resource in the Azure portal and choosing 'Channels'. As you can see, your bot is already available via the web channel. From here you can choose to make your bot available on other channels like Microsoft Teams or Skype.
For example, to make your bot available on Skype, follow these steps:
Click on the featured 'Skype' channel. This will make your bot accessible from Skype.
Go back to the 'Channels' list. Skype should now also be shown in the list of channels for your bot. Click on the link 'Skype'.
A new page will open. Click the 'Add to Contacts' and follow the instructions to add your bot to your Skype contacts
Note: it may take up to 30 minutes for your bot to be fully deployed on Skype, even after you have added it as a contact in your Skype app.
Adding media to messages
To add media or cards, this connector looks for an output parameter msbotframework in the engine response. The value of that parameter is assumed to contain the media or card JSON as defined by Microsoft.
If we look at Microsoft's specification of an image attachment, the value of the msbotframework output parameter to attach an image would need to look like this: