How to integrate api.ai bot with any booking site to book/order something? - webhooks

I've made a chatbot who can talk to people and make a normal conversation. I want to develop that chatbot so that user is able to, say order a pizza from Dominoz.com or Book a ticket on expedia or add something to cart in ebay.
I've made the bot using Google's Api.Ai (diagflow). How can I integrate it with any site performing some kind of transaction. Answer with an example booking/ordering site would be highly appreciated.
Just for additional info: I think it is possible by that webhook option in fulfillment section. But how exactly? How to implement it?

You should check if there are APIs available for ordering/booking through Expedia/eBay. Dominos have exposed their APIs for ordering purposes. Following is the link for bot ordering pizza & node-dominos-api
https://hellotars.com/bot-examples/featured/pizza-ordering-chatbot/
http://riaevangelist.github.io/node-dominos-pizza-api/
https://www.youtube.com/watch?v=F68HtCtJbGA
Webhook in Dialogflow is something where your actual logic lies. You can write it in any language you're confident of & host it somewhere for Dialogflow to communicate with it. There are 2 API references v1 & v2. Your web service receives a POST request from Dialogflow. Your request/response to/from webhook should include mandatory fields mentioned at following links:
https://dialogflow.com/docs/fulfillment
https://dialogflow.com/docs/reference/agent/query

Related

Azure Bot Creation with Natural Language understanding(LUIS)

I am facing issues while building a Voice bot using nodejs in Microsoft Azure, Currently i have made some research and built a sample chatbot which works fine using nodejs.
I have tried MS portals for voice bot integration and unable to take it forward, need guidance and suggestions.
My idea is getting a number from Twilio, then put my azure bot's end point URL in the twilio number.
Once my twilio gets an incoming call it will route the request to the Azure bot which will respond with a greeting and ask for few inputs, then the recorded voice should be passed to the LUIS app for Natural Language understanding and give the required text which will be further handled by the Azure bot.
I am not sure whether this is good solution, please suggest
I am not able to see any sample code for nodejs. Steps for integration and a basic sample code is what i need as a basic to start with, Your inputs/suggestions on this is highly appreciated.
Using the Bot Framework SDK for Node.js, you can specify text to be spoken by your bot on a speech-enabled channel in either of the following ways:
Set the IMessage.speak property and send the message using the session.send() method
Send the message using the session.say() method (passing parameters that specify display text, speech text, and options)
Send the message using a built-in prompt (specifying options speak and retrySpeak).
Feel free to review the following documentation provided and sample code for more details.
Update
Also check out Connect a bot to Twilio.

Dialogflow human takeover

I am creating a bot for a bank using Dialogflow. I wanted to keep am option to talk with a Customer representative. If a customer wanted to talk with a customer representative, the bot Should stop and the customer representative starts the chat with a customer. How it is possible In Dialogflow.
That option is only available by creating your own custom implementation.
Check out this example here
It can also depend on the channel you are using For example, if you are using Facebook Messenger you can achieve that using the Handover Protocol in your custom implementation
This is currently not possible because dialogflow does not provide any web interface to achieve this, but in dialogflow usually the "input.unknown" action used to deliver a conversation to a human. Default fallback intent is triggered and the associated action is added to the response, and you also need to write a logic to what bot should do after that.
But if you're looking to avoid this hassle, I 'd suggest you use a chat widget tool like Kommunicate, which provides a dashboard UI as well as a chat widget. In fact, they also have a pre-built rich message template to create menu options to deliver a conversation to a human agent. Please check this link for more info
PS: I work for kommunicate
Another option is if you have the phone gateway integration enabled, Click 'Add Response' under the DIALOGFLOW PHONE GATEWAY tab and just select Transfer Call.

Sending a message to user when user enters a geofence / area?

I'm making a dialogflow agent that will be integrated with various platforms (Facebook messenger, slack and maybe a few others) that will have the basic functions of a informational chatbot.
The agent will be for a specific store and I'm wondering if it's possible to trigger some sort of welcome message once the user enters the geofence (in this case, the store)?
Thanks for the help. I haven't found any documentation for this on dialogflow specifically or anywhere else so anything will be awesome.
Note: I'm am not by any means dead set of dialogflow, if AWS Lex offers something like this and it's better, I will take a look. I'm just a bit more used to dialogflow.
This cannot be achieved just by using either Lex or Dialogflow. Because at the end of the day, you are using them to integrate with Messenger/Slack/Whatsapp and these apps will (for obvious good reasons) not share the user's location information with the bot. You will need a helper app which takes the user's location permission as well and triggers the bots for you.
Keep in mind that channels like Messenger and Whatsapp have restrictions over sending messages willy-nilly to users. Messenger has a '24+1' policy Whatsapp also you can only send free form messages in the 24 hour window. But after that you can send chargeable pre-approved "hsm" message templates.

How to create a chatbot with facebook messenger like templates

I'm trying to create a chatbot for use in a chat app I've created. I basically need the chatbot to send me replies that have message templates like in facebook messenger. For example, If I type in "what's the weather like", I want my chatbot's reply to look like facebook's media template, linked here: Media Template
Does anyone have any tutorials or links I can follow?
Thank you in advance.
Cheers!
Usavaully work flow of chat application as follows,
Message providers(Facebook, twitter,slack etc..) receives messages from user
Message is sent to the configured endpoint(your webserver) according to the settings provided in the face book developer page reference
In the webserver you classify the intent prepares the response according to the request and sends the responses back.
So in the 3rd point web server you give responses based on the platform you are responding to reference, since in your case it's your own platform you need to design your own UI based on the response format or you can use some predefined html templates.
I hope answer gave some direction to work on.

How to end bot conversation and let real person handle responses in Dialog Flow?

I am developing a bot for business using Dialogflow. I want to keep an option "Talk to real person". When my customer wants to talk to real person, bot should stop and someone from my support staff will take care of that user.
How is it possible?
How can I pause/stop my bot and let real person handle conversation?
While searching for answer, I send an email to Dialogflow support and got this reply next day.
At this moment, you'll need to handle the task of passing conversations from bot to humans in your custom implementation. You can take a look at the following sample: https://github.com/dialogflow/agent-human-handoff-nodejs.
Hope this may help someone else having similar issue.
By native google, Dialogflow doesn't support bot to human handoff or provide any Web interface to achieve this, but in dialogflow normally the action “input.unknown” used to hand off the conversation to a Human. The “input.unknown” action is built into Dialogflow and used with the default fallback intent. When none of the intents is matched, the default fallback intent is triggered and action associated with it is added in the response also you need to write a logic what bot should do after that.
But to make things easier you can integrate dialogflow with any third-party tool like Kommunicate. As they provide pre-built chat widget user interface and bot to human handoff can be enabled on a click of a button, Please click here for more detailed information
PS: I work for Kommunicate
The issue is related more to the external software that implements Dialogflow than Dialogflow itself.
You can use the PHP code of Support Board as a starting point, or you can use the Support Board software for that directly. It has the feature that asks the user if he/she wants to contact a human agent when the bot does not understand the question. If the user accepts the bot is automatically disabled and an email is sent to the agents.
More details at https://board.support/
PS: I work for Support Board

Resources