Customise Azure bot framework in NodeJs using DirectLine JS - node.js

I am looking for a solution which has Customised Azure bot in website. I am not looking for an iFrame integration, As i have already explored. I need a solution which gives me an option to make UI changes in the bot window and invoke Live agent Chat window(Third party) from the existing Chatbot.
I tried these link below which dint help
https://github.com/Microsoft/BotFramework-WebChat

I understand exactly what you need.
It's true that the github url you pasted won't help but I know you'll get a lot of tips from the Direct Line and DirectLineJS documentation from the Advanced part.
You simply need a way to integrate to the Bot Framework from your existing UI system and hence using the Bot as just an Endpoint.
Your solution lies in the actual implementation methods for various channels that is supported by Bot Framework. Take Skype or Facebook for instance.
You need to study and configure WebHooks, Direct-Line Channels.
First: Use the Azure Portal to add a new website to your Bot in Channel property.
Secret Keys would be generated for you after then you can configure for version 1.1 or 3.0.
Check the Documentation here: https://learn.microsoft.com/bot-framework/rest-api/bot-framework-rest-direct-line-concepts
Now your site can be configured to talk to the Bot Framework via Web Clients and Sockets as API requests.
With these, you have the priviledge to use your own UI with the Bot Framework.

Related

Bot Framework Composer DirectLine

I hope you can help me in this problem
I have created a chatbot in the azure framework
Bot Framework Composer and I want to use it in WhatsApp Bussines
. My problem comes for the reason that bot framework composer
It still does not have a direct channel to whatsapp or any
platform like Twilio or Gupshup. I was recommended to use
the azure "DirectLine" channel that comes integrated, to take
the endpoint of my chatbot produced by azure when deploying it
in my group of resources and so with the keys of the channel that I
provides "DirecLine" to be able to interact with my chatbot. try
do the tests with the endpoint of my chatbot through Postman
but I have not been successful, despite following the documentation as indicated
microsoft, gives me an answer that is not authorized
I folow this steps
step 1
step 2
step 3
step 4
This is regarding the authentication error. To rectify the problem, here is the road map to follow.
Goto portal.azure.com
Search for Azure bot
Give the details of bot handle name and subscription. Mention the valid resource group name.
3. After creating the bot. Click on Channels where we need to create Direct Line access
Select the Direct Line
Click on New Site
Create a new site and key the key information
Now, using those keys we need to perform authentication operation.
Under the version in the above image, need to select 3.0, as Azure Direct Line authentication is functioning with REST API with 3.0 version of Direct line API
To enhance the authentication option, you can enable the Enhanced Authentication Option which is not functioning according to the current requirement in the case mentioned in question.

What is Direct Line in Azure?

I am starting to develop a bot for Teams and I do not understand the various channel offerings. I know I need to add Microsoft Teams to the channel list in Azure for the bot to be able to message people through chat channels, but I can't figure out how to allow the bot to communicate with an API that is hosted in AWS. Maybe Direct Line is what I'm supposed to use, but the documentation is very unclear. Here is what I can find about Direct Line:
Direct Line. This is the standard channel offering of Direct Line. It works by default with bot templates via the Azure portal, bots from the Bot Builder Samples, and bots created with the Azure CLI. This is the Direct Line best suited in the majority of the cases. See Connect a bot to Direct Line.
If anything, I became more confused after reading that. It raises more questions than it answered. If Direct Line is supposed to allow me to communicate with third-party APIs, I don't know how to get started even if I enable it. The BotBuilder repository documentation does not mention Direct Line channels, at least not in an obvious way, so that hasn't been much help either.
I have very little clue about how this works even though I spent my whole day reading about it. Deploying a bot to Teams that can make a call to another API is much more difficult than I anticipated. All I want to do is say #bot command and have it call an API to make a GET request. Once I am able to do that, I will be able to develop the rest of the application, but using the requests module in Python has not worked and I don't know why.
Anything you can offer about how this should work would be greatly appreciated.
Direct Line, as the name implies, is a direct line of communication to an Azure bot. Essentially, it is a set of APIs that you can use to communicate with an Azure Bot outside the set of provided channels. If you are building a custom application that none of the other channels such as Web Chat, Teams, Email, etc. would be appropriate for, then you can use the Direct Line API to send and receive messages to and from a hosted bot with REST calls. The API reference in the documentation explains how to connect to and use Direct Line. You would implement these calls into your application as you would calls to any other REST API and display the responses in whatever manner fits your use case.
The key intuition here is that Direct Line is only for communicating with the bot. It has nothing to do with connecting to outside services. Communicating with 3rd party services would be accomplished in the same manner as any other application. I don't know how you've implemented your application or what service you're connecting to, but I would suggest you double check that your calls to that service work outside your bot using Postman or curl before attempting to implement them into the bot.
Your use case would appear to be the Microsoft Teams channel, and not Direct Line.
I'm not totally clear either on what Direct Line is for, but from what I can understand it would be if you want to include a bot experience in your own custom app, like a desktop app with a "chat" feature. It's definitely not needed for Teams though - you only need the Teams channel.
With regards calling an API from within your bot, essentially your bot is just a standard web service - it can do anything any other kind of web service / web api can do, e.g. calling a 3rd party API.

How to integrate dialogflow chatbot with Microsoft Teams?

I am a newbie to chatbots, and built one agent in dialogflow and written a node server to connect it with my custom UI. Now my next requirement is to integrate this bot with my Microsoft Teams Channel.
For what I have searched there seem to be similar steps being followed as with skype but those didn't make sense to me. Though I am not really clear about it, if anyone can give a step wise points to follow to do the same, it will be great help.
Also just to be clear, can someone confirm if it's really possible to integrate Google's dialogflow with Microsoft's Teams?
I don't know of any official instructions explaining how to connect a Dialogflow bot to Teams, but Skype and Teams both communicate through the Azure Bot Service using the Bot Framework protocol. When a Dialogflow bot connects to Skype what it's really connecting to is the Azure Bot Service, so you should be able to follow the same instructions for any ABS channel, Teams included.

Which key to use in Bot.App secret property, one from Direct Line or Web Chat Channel?

I have configured a Web Chat Channel and a Direct Line Channel on Azure Bot Service. I am using the web chat control on the client side i.e. on a web page to provide a UI to users. For now I am using the Web chat control as it is i.e. included botchat.js in html served from my local server and also botchat.css which I have modified to give a custom look n feel.
There will be requirement in future where I might have to create a custom build of Web Chat control source code, to reduce the overall size of botchat.js file and do some custom implementation as well. My question is it right way to use the UI for a website. Please share your experience and best practice for the same. Are there any other ways to do UI for Website, because I want to support the flexibility of displaying various types of responses like text, video, hero cards etc.
Also, for now I am passing the secret key in the BotChat.App code, but I am confused which secret key to use, the one from WebChat Channel or DirectLine Channel.
To answer your initial question and per the official documentation found here (I'd recommend checking it out as well):
The Web Chat channel in the Bot Framework Portal contains everything you need to embed the web chat control in a web page. All you have to do to use the web chat control is get your bot's secret key and embed the control in a web page.
This refers to the WebChat channel this is of course if you were referring to connect your bot to Web Chat, Directline has the following purpose:
You can enable your own client application to communicate with your bot by using the Direct Line channel.
When it comes to UX/UI, I'd recommend the following blog post which provides some best practices and examples related to the area.

Where is Microsoft.ServiceBus.Notifications.NotificationHubClient?

I have started learning about notification hubs and have gone through some tutorials.
Now I need to send messages from my ASP.NET WebAPI 2 backend to the notification hub. So I decided to learn about the Notification Hubs Rest API.
On this link It is written that Microsoft already provides a .NET wrapper around the REST API in the Microsoft.ServiceBus.Notifications.NotificationHubClient on this page.
But on clicking the link it says topic is no longer available.
Now I need to learn about how to send push notifications from my asp.net web api backend and azure website seems to have only one tutorial which is this
So can someone please point out where is Microsoft.ServiceBus.Notifications.NotificationHubClient or some tutorials or other library if this one is outdated
is there a specific reason you want to implement the solution using REST API directly? I would not recommend that unless you have the reason. There is a Microsoft.Azure.NotificationHubs library that you can use for your Web API solution, and the tutorial you mentioned is the right one (you can install it using NuGet). For more fast proof of concept implementation, you can skip the authentication part here, however it is good one to know.

Resources