{"id":2221,"date":"2017-05-18T21:35:42","date_gmt":"2017-05-18T20:35:42","guid":{"rendered":"http:\/\/blog.repsaj.nl\/?p=2221"},"modified":"2017-05-29T19:38:55","modified_gmt":"2017-05-29T18:38:55","slug":"o365-adding-your-chatbot-to-skype-for-business","status":"publish","type":"post","link":"http:\/\/blog.repsaj.nl\/index.php\/2017\/05\/o365-adding-your-chatbot-to-skype-for-business\/","title":{"rendered":"[O365] Adding your chatbot to Skype for Business"},"content":{"rendered":"<p>Have you been coding your chat bot using the Microsoft Bot Framework? Good news! One of the long awaited features is finally here: the Skype for Business channel! Using this channel, you can now get your but to communicate with users using Skype for Business. This is especially good news for enterprises where S4B is often the primary communication tool. Bots were already available through Microsoft Teams, but not all companies are ready for that yet. Skype was in there as well, but is mostly used on the consumer side. So great to have Skype for Business joining the club!<\/p>\n<p><!--more--><\/p>\n<h2>How to enable the Skype for Business channel<\/h2>\n<p>Enabling a bot for a new channel is usually pretty simple. The Skype for Business channel though requires a bit more work.<\/p>\n<p><strong>Note:\u00a0<\/strong>in order to perform this step you need to be an admin of your Skype for Business instance.<\/p>\n<p>Here&#8217;s what you need to do:<\/p>\n<ul>\n<li>Go to <a href=\"https:\/\/www.botframework.com\">https:\/\/www.botframework.com<\/a>, log in and click on the bot you want enabled.<\/li>\n<li>Add the Skype for Business channel to your bot.\u00a0<a href=\"http:\/\/blog.repsaj.nl\/index.php\/2017\/05\/o365-adding-your-chatbot-to-skype-for-business\/skype4b\/\" rel=\"attachment wp-att-2222\"><br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2222\" src=\"http:\/\/blog.repsaj.nl\/wp-content\/uploads\/2017\/05\/skype4b.png\" alt=\"skype4b\" width=\"504\" height=\"220\" srcset=\"http:\/\/blog.repsaj.nl\/wp-content\/uploads\/2017\/05\/skype4b.png 504w, http:\/\/blog.repsaj.nl\/wp-content\/uploads\/2017\/05\/skype4b-300x131.png 300w\" sizes=\"(max-width: 504px) 100vw, 504px\" \/><\/a><\/li>\n<li>When the channel has been added, the page will\u00a0display:<br \/>\n<h4 class=\"m-header-medium config-panel-heading\">Your bot is enabled for the Skype for Business Channel.<\/h4>\n<h4 class=\"m-header-medium config-panel-heading\">Want to add your bot to Skype for Business tenant?<\/h4>\n<p class=\"m-header-medium config-panel-heading\">underneath is a link that says\u00a0<strong>Learn how<\/strong>. The link could&#8217;ve better been a button if you ask me, there&#8217;s not much emphasis now even though the instructions on that page are critical to get it working.<\/p>\n<\/li>\n<li>The page will list some commands you need to run in a Powershell window. First,\u00a0<a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=294688\">Download and install the Skype for Business Online Connector module<\/a>\u00a0and then run:\n<pre class=\"lang:ps decode:true\">Import-PSSession (New-CsOnlineSession -Credential (Get-Credential))<\/pre>\n<p>&nbsp;<\/li>\n<li>This will enter you into a session connected to the remote Skype for Business cmdlets. Now you need to register your bot:\n<pre class=\"lang:ps decode:true\">New-CsOnlineApplicationEndpoint -ApplicationId 110e87ba-9f5e-407e-a199-037e0f05bb35 -Name NameOfTheBot -Uri sip:username@yourdomain.com<\/pre>\n<p>&nbsp;<\/li>\n<\/ul>\n<p>There&#8217;s a little catch here. The example says\u00a0<strong>username@yourdomain.com<\/strong>. Actually this should&#8217;ve said:\u00a0<strong>username@tenant.onmicrosoft.com<\/strong>. Adding a user using a custom domain as the sample shows does not work, at least not at this time. You&#8217;ll get a pretty non-descriptive error saying &#8220;Cmdlet invocation error&#8221; and &#8220;Could not find the application endpoint&#8221; if you try to do it this way. So make sure you pick a user from your tenant and that you use the tenant.onmicrosoft.com domain to identify it.<\/p>\n<p>Now your bot will, after a wait (which can take up to 8 hours), appear in Skype for Business and users can interact with it. There are numerous possibilities for this. For instance, our bot helps us with tasks like requesting leave, booking hours and remind me to book my hours when I once again forgot to \ud83d\ude09<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">Update:<\/span><\/strong><span style=\"color: #ff0000;\"> after waiting for a while, you might be able to find your bot in the Skype directory, but interacting with it doesn&#8217;t work. This problem is being looked into, as soon as I know a way to resolve it I&#8217;ll update this blog post accordingly.<\/span><\/p>\n<p><strong>Update 05\/29:<\/strong> after waiting some more I decided to delete the endpoint and retry creating it. And sure enough, my bot is now responding! Problem solved, it seems.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/blog.repsaj.nl\/index.php\/2017\/05\/o365-adding-your-chatbot-to-skype-for-business\/jennifer\/\" rel=\"attachment wp-att-2237\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-2237\" src=\"http:\/\/blog.repsaj.nl\/wp-content\/uploads\/2017\/05\/Jennifer-296x300.png\" alt=\"Jennifer\" width=\"296\" height=\"300\" srcset=\"http:\/\/blog.repsaj.nl\/wp-content\/uploads\/2017\/05\/Jennifer-296x300.png 296w, http:\/\/blog.repsaj.nl\/wp-content\/uploads\/2017\/05\/Jennifer-60x60.png 60w, http:\/\/blog.repsaj.nl\/wp-content\/uploads\/2017\/05\/Jennifer.png 705w\" sizes=\"(max-width: 296px) 100vw, 296px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you been coding your chat bot using the Microsoft Bot Framework? Good news! One of the long awaited features is finally here: the Skype for Business channel! Using this channel, you can now get your but to communicate with users using Skype for Business. This is especially good news for enterprises where S4B is<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[34],"tags":[78,192,60],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3KFR1-zP","_links":{"self":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/2221"}],"collection":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/comments?post=2221"}],"version-history":[{"count":0,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/posts\/2221\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/media?parent=2221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/categories?post=2221"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.repsaj.nl\/index.php\/wp-json\/wp\/v2\/tags?post=2221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}