Skype for Business is one of the collaboration tool in corporate to enable enterprise instant messaging platform to millions of users. The BOT framework is not yet supported in Skype for Business on_prem version but it could be developed by playing around UCWA component which is part of Skype for business web component.
To Enable the chat bot in Skype environment, you may have below 3 scenarios. So let us find out what is available in all this scenario.
- Skype for Business Online – Go here for more details
In case, your SFB environment is purely located in online, you can leverage the Skype for Business Bot Framework channel.
- Skype for Business hybrid – Go here for more details
Skype for Business bots can be connected to Skype for Business Server users if Hybrid connectivity has been deployed in the environment.
- Skype for Business On_Prem
Skype for Business On-Premise has a set of APIs called Unified Communications Web API(UCWA) which can be leveraged to integrate with the Bot framework.
We are only going to cover scenario 3,” How can be used UCWA API to integrate with BOT” – The architecture of the application will look like below.
UCWA 2.0 is a REST API that exposes Skype for Business Server 2015 instant messaging (IM) and presence capabilities. For a bot to send and receive message using UCWA, the following steps are required to be performed.
- UCWA URL
If your application would perfor auto discovery using SFB credential then step 1, is optional, otherwise you can use the UCWA URL to query to Skype for Business UCWA server (Which is SFB Pool frond end server)
UCWA always runs in the home pool of the authenticated user account used in application for chat bot. The purpose of the autodiscovery flow that is described here is to find the location of UCWA.
This below step will be executed for the first sign-in and succeeds when the client application retrieves the UCWA URL. This URL can be cached until a failure occurs.
- The application queries the discovery URL (lyncdiscoverinternal.domain.com (If UCWA URL is not hardcoded) once application supply SIP URI format firstname.lastname@example.org
- If response of above URL failed then it will try another URL (lyncdiscover.domain.com)
- The security check step consists of making sure that the client is not spoofed
- The client can follow the redirect link in case multiple pool in skype server
- The response from Autodiscover is a response with a link to the user
- The final response contains a link to the applications This is the link that is used to create the application.
The application will now poll the Skype server for incoming messages. When a message is received by the application, we bootstrap our bot and pass the text as properly formatted Activity message. The bot then follows usual flow of sending the text to LUIS and determining the intent. Based on the context, it will then send the response back to the user. The end to end architecture of the bot can be seen below.
Now, We are only left left to build the application. As I am not from programming background, below link is written in very nice way !!!
Skype for Business bot using UCWA development – Go Here