I am working in Dialogflow right now, is there any way to initiate chat using webhooks instead of using the common welcome massages given by dialogflow or some chat apps. Like I want to have my own initialize chats for many different situations. For example, today is my day to save money, then it will initiate a chat to make sure user get into save_money_daily intent. More details on the comment
There are few things that you wanted to do here that are not natural, I guess. Let me go on each:
How can I send an automatic chat for every possible case from the backend automatically?
Ans: You are building a google assistant on dialog flow, using as a chatbot, any chatbot can not send an automatic message(unless set by user), chatbots, and assistants are in the nature of the user interaction.
Let's any bot on Facebook, Skype, or any platform even the google assistant, they can't popup unwantedly with any information, it will be not user friendly.
There is a way to do, like if the user is interacting with your bot: You can ask like:
'Do you want me to remind you for saving money every day'
If user gives permission, save it in-app local cache and send app notification, via. Once the user get the app notification you can invoke the chat on the app notification click and open chat screen with your reply, but in the background when the user clicks on app notification you have to send a request to initiate chat.
And this solves your second problem as well.
Let me give you a high-level example:
Three Intent: With some user utterance
GetLatestMoive: ['get me the latest moives list']
GetLatestNews: ['Headline for today']
HealthCheck: ['I want health tips']
Create Notification and send it to the user via the app:
Based on the notification if the user clicks any of them, initiate your chat in-app with that utterance, it will automatically call the intent, and rest will follow based on your intent follow up a map and conversation design.
Hope this helps!
Related
I am using Dialogflow with the the V2 C# client library. When the user provides the Chatbot with an address, I use a web-hook to send the address to my back-end.
My back-end then validates the address and does some other things (my back-end takes about 2 seconds).
However, I would like the chatbot to respond to the user with something along the lines of "Give me a second and I will validate the address you provided me" before my back-end has finished.
Then once my back-end has finished, respond to the user with the results of the address validation. I don't want to accept input during the 2 seconds my back-end is processing.
In summary, I would like to know, what is the best way to acknowledge a user's input with a message, not accept any further input until my back-end processing is complete and then finally responding to the user with the results of my back-end?
You need to manage this via contexts. If you are using Dialogflow SDK instead of the UI, you could control all of this via code which is more convenient.
If you are using the GUI, set an input_context and give it some lifetime as you see fit. On your web-hook's successful resolution, update or cancel respective input_context via an output_context to demonstrate completeness of a request.
By using contexts event if user asks any other question, you will not loose previous question and its answer will still be rendered to user.
Disengaging the chatbot by not taking any questions might not be a good user experience. If you really wanted to do it, you will need some JS to help you create a loading/processing sort of icon on your bot's interface for specific intents while you programatically control the mute & unmute commands on the UI.
Just a preface. You can skip to the next heading.
I'm working on a startup with a limited budget. Recently, I've been trying to design a RESTful API as a backend for the mobile app i'm working on. (A Web based SPA client is going to be developed in near future too). Of course it's not a public API but we know it "can" get revealed by tampering network activity or investigating the Web Client source files.
Almost all of the API methods are protected using JWT-based Token Authorization EXCEPT user registration method which accepts an email and a password and creates a user. So, the system would be vulnerable to spammers.
SMS as the best solution
You can skip to the next heading.
I've been investigating various approaches like IP rate limiting and CAPTCHA on mobile app (!) to block spammers but none of them were satisfying. So I came to the idea of E-mail verification which would not be the best approach either. Spammers can easily create fake E-mail addresses and parse incoming mail contents to validate their batch of registered accounts.
The best I found out so far is to use SMS verification. Phone numbers are not easy to fake and each of them will cost for the spammer. It's not perfect but minimizes the risk. So i decided to generate and store a key in DB, send it to the user via SMS, and require them to enter the code in the app. Then, if correct, register the user and store the phone number to prevent multiple usages of the same number. So far so good.
Telegram Bot as a replacement of SMS Verification
As the budget is limited, i've came to the idea of using Telegram beside SMS verification to reduce the costs related to SMS Service Providers. So here is the idea.
Telegram uses the same approach. It verifies the phone number on user registration. Thus, we can rely on the fact that each Telegram user is a real person with a valid phone number. So, I can develop a Telegram bot named like ValidatorBot, and use Deep Linking feature to start the bot with a parameter indicating the registration request which is going to be validated:
https://telegram.me/ValidatorBot?start=user_registration_token
And then show the link above as "Register Using Telegram". When the user opens the link and Clicks on START button of the bot screen, a message containing user_registration_token would be sent to my server, so i can mark the registration process identified by user_registration_token as a valid process and continue with registering the user and store their Telegram User ID to block multiple account creations with a single Telegram account.
I haven't seen any implementations like this before and could not find anything relevant on the web about it. Here are the different aspects that I could analyze so far:
It would not be a user friendly way to make them open Telegram, click on Start, then switch back to the app to be able to continue.
A Telegram User can be deleted. The spammer can delete their Telegram user, create a new one using the same phone number, and register again with a new Telegram UserID. Although, it's not such a big concern because Telegram denies multiple registration intents by a specific phone number in a limited time domain for at least 24hrs. (Three registrations per day I think).
What do you think? Do you see any gaps in this verification method? Any security flaws?
Would it be better not to rely on just pressing START button and show a code to user after pressing it, and requiring them to enter the code in app? (Like how it was in SMS method) Or getting START signal is enough?
You can request phone number by Telegram bot button and get real phone number of the user, so you can save your money for SMS price.
My app is a self care app. In this app user can pay his bills once he is logged in. I am able to open the app successfully via Siri. Just wondering if I could pay the bills via SIRI
While opening the app I could do login in background with saved user credentials in app.
In Payment intent handler I can send the payment response to SIRI.
In iOS 10 there are two different uses for Siri. Sirikit is to register intents, such as booking a ride or making personal payments. The intents are limited to what Apple has outlined here although I am sure they will expand in the future:
https://developer.apple.com/sirikit/
The other is to use Speech Framework to transcribe speech to text. You can do whatever you want with that input, but it only works if the user opens the app and then you initiate Speech recognition.
https://developer.apple.com/reference/speech
I've seen this use case a few times.
A user goes to a company's web site and places an order with the company.
User logs into Facebook.
Messenger window shows up that says order confirmation # and now there's a chat between you and the business.
I'm trying to figure out how this is done.
Of course, if the user has given the app permissions or there was some Facebook integration on check out, then presumably the company has captured the user id and can send messages.
Is there any possible way that a company can send a message to a user by simply knowing their e-mail address? I think FB ids are scoped to Apps so even if you knew the user's FB Id, the ID on your app would be different. Any ideas?
I did it with ruby on rails.Let me give my articles about messenger bot.
This link show from scratch. and it uses this gem to make it happen. These are so useful articles. if you have additional questions, please let me know.
I was mid way through building an app, when I realized that a core part of the app I was planning to build (an event notifier), wouldn't work as event invites sent via the Facebook API do not show as a notifications.
This is the notification I got:
It's not a notification for an event of course, but I don't know what other API methods invoke a user notification (or could invoke one).
If anyone could let me know the API method they're using, I'd be very grateful. (I'm thinking it's perhaps because they use a canvas app, while I was planning on building a web app).
It's a user-to-user request, which is called an invite if the user it’s send to hasn’t used the app yet. For apps in category games it shows up as „have been playing”, for other apps it just says „john doe sent you a request in xy”
How to send them via your app, see https://developers.facebook.com/docs/requests/