Is it possible to receive a message from a webchat (on a website) and forward this message to Whatsapp using Twilio? - twilio

I'm looking into the Twilio Whatsapp API docs, and cannot find anywhere if it is possible to receive a message sent from a website webchat on a Whatsapp Business Account?
I would like to develop the following:
a user is on my website, and has a quesiton. He/she then opens the chatbox and types their question (non-whatsapp). This message is then sent to the Whatsapp Business Account of the Client and they can talk back and forth with the user.
I hope I have been clear enough, please let me know if I need to supply more information.

Twilio developer evangelist here.
I believe that this would be possible to do for one user messaging at a time, but practically and at scale, not really useful.
If you have a user sending a message through a website that is then delivered to a user through WhatsApp, you could build an application that allowed the user on WhatsApp reply to the message and relay that back to the website.
However, if you have one WhatsApp number registered to send messages on behalf of your application and multiple users were sending messages through the website, all the messages would come from that one WhatsApp number and it would be practically impossible for the user responding in WhatsApp to know who they were responding to.
It would likely be better to connect your users via webchat within the web application and use WhatsApp to notify the the client that there are new messages awaiting their reply.

Related

Can i directly send message to recipient using Twilio WhatsApp api without using join [key-word]. Is it because of Twilio Sandbox?

Can I directly send message to recipient using Twilio WhatsApp api without using join [key-word].
Is it because of Twilio Sandbox?
If I send request to enable my Twilio number of WhatsApp, issue will get resolved and I can send messages directly?
The join [key-word] system is just for the Twilio Sandbox for WhatsApp. It allows Twilio to use one WhatsApp number for all accounts that are testing with the Sandbox.
Once you have connected your Twilio number to your WhatsApp business profile you will be able to send messages to your users without requiring them to message you first. Note that WhatsApp does still require an explicit opt-in from your users before you can send to them. Also, for initiating conversations you will need to get template messages approved and then use the template as the first message. But the technical barrier of the join message will not be in your way.

How send notification to Team user

We have tried to send notifications to Microsoft teams. We have created a bot using this we can send but users want to initiate the conversation.
Also tried graph API shows 401 error.
We want to send notifications to Bot or API without the user initiating the conversation. i.e. sending notification direct to user chat.
Please help?
You can send message to user with out user interaction using graph API. Proactive messages are initiated by bots to start conversations with a user. They serve many purposes including sending welcome messages, conducting surveys or polls, and broadcasting organization-wide notifications. Proactive messages in Teams can be delivered as either ad-hoc or dialog-based conversations. Please check Proactive installation of apps using Graph API and send messages

HTTP GET request for user's phone number in fulfillment editor

We are setting up a chat bot through Dialogflow. A user will receive a weblink to the bot in a call or SMS sent through twilio. I'm wondering if it is possible for us to set up an HTTP get request to twilio in fulfillment so that we can set a context parameter to the user's phone number in the fulfillment inline editor in Dialogflow.
I took a look at twilio's api docs but could only find information on HTTP requests regarding numbers purchased or available for purchase through twilio.
So to clarify: in Dialogflow's fulfillment inline editor, we want to set a context parameter equal to the user's phone number that twilio called or sent the SMS to with a weblink to our chat bot.
Thanks!
Twilio developer evangelist here.
If I'm understanding right, you want to send a URL to a user via SMS (or over the phone?) which will link them to a web based chat with your bot. And you want to be able to link that chat back to the original phone number?
If that is the case, then the first thing that comes to mind for me would be to create a unique URL for each phone number you send this message to. If you store a link between the URL and the number it is sent to in a database somewhere, then when th euser clicks through to it you can recover the phone number and apply it to your Dialogflow context.
I don't believe you need to make any requests to the Twilio API for this aside from sending the initial SMS.
I hope this helps.

Override Message Service inbound URL programatically

I have setup a trial Twilio account and have been investigating their
Programmable SMS service. Within my account I have also setup a Messaging Service. When I send an SMS I am able to set the URL I wish Twilio to send all delivery events (e.g accepted, sent, delivered etc) to, using a field called statusCallback. However, I am wondering if it is also possible to set the URL for which I wish to receive any replies to the message being sent, as part of the send SMS call? I know I can change the incoming request URL within the Messaging Services area of my Twilio account dashboard, but I would like to be able to set this URL on a per SMS basis, as part of the send SMS API call.
Does anyone know if this is possible? I cannot see anything in the docs to suggest it is but I wanted to know definitively.
I hope the question makes sense but if any clarification is needed then please let me know.
Thanks,
Paul

Implementing new phone number and SMS messaging functionality in Ruby on Rails web app

I have an existing web app built using Ruby on Rails. It already has a built-in email messages feature. Our users have requested for a functionality which is able to do the following (for US users only):
Get a unique and new US phone number which is tied to their registered email address (user ID in our web app
For others (users or non-users) to be able to send our registered SMS messages to this new number. The registered user will get a notification that he has received an SMS and will then go to Messages module to retrieve the SMS
The registered user should also be able to send an SMS message from his Message module to other users and their mobile numbers. These users will not be receiving the content of the SMS but rather be getting a notification that they have receved a SMS from our registered user and now they need to either creae a new ID or login using existing credentials and authenticate phone number in order to retrieve SMS from our user.
Question: What Ruby Gem could be used for such functionality?
Also, are there APIs and open source code available for such functionality?
I would also like to kee my costs low for all the above as we are still a start-up company.
Thanks in advance.
You might consider checking out Twilio (disclosure: I work for Twilio).
Twilio has a Ruby gem that provides a high-level API for sending SMS messages and buying phone numbers. You can also receive incoming SMS messages to a number by specifying "webhook" URLs that will receive an HTTP request when a message is received. You can sign up for a free trial account here.
Some relevant bits of documentation:
Sending an SMS
Find an available number (note: you can also do this through the GUI)
Buy the number you found (note: you can also do this through the UI on the site)
Responding to incoming messages

Resources