How to save twilio ip message to a database? - twilio

I'm discovering twilio ip messaging and i want to make a simple basic chat application. It's not so difficult but i want every sent messages to be stored in a database.
I was seeking some solutions into the twilio user interface but no such things to help me to solve this issue.
I am using amazon dynamodb. How could i process it so that each time I relogin to the chat i could see messages from the last session ?

Twilio evangelist here.
I think you are looking for the onMessageSend webhook:
https://www.twilio.com/docs/api/ip-messaging/webhooks
You can configure for IP Messaging Service instance with a URL for this webhook either in the account portal or via the rest API. Twilio will request that URL whenever a client sends a message to the channel. The webhook will include the sender id, channel id and message which you can save to your database.
Hope that helps.

Related

Twilio: track user action on SMS links and reply based on that action

I using twilio flow to create simple chatbot that sends user a whatsapp message with link to provide some details and once user has provided the required details on web page, chat bot must reply with a THANKS message.
Is there anything like postback using rest api on active execution based on which a thank you message can sent.
Please have look on diagram as well.
Twilio developer evangelist here.
When you say you are using Twilio flow, I guess you are using Twilio Studio to send the messages. In this case, I don't think you can achieve what you want with Studio. You can't move an execution on with the REST API.
However, it should be fairly straightforward to send the thank you message from your application using the Twilio Messaging API instead.
What you will need to do is, when the user submits the form, in your back-end code as well as saving the data to your database, make a call to the Twilio API to send the WhatsApp message. I'm not sure what your application is built in, so I've just linked to the relevant documentation.

How to initiate a 2 way SMS conversation between to validated phone numbers

We have the need to open an SMS conversion between clients and service providers. The thought is to send an initial request to the provider with a message from the client and then have the provider reply (and converse) directly with the client.
I've looked in the quick starts and the API docs but I don't see any clear pathway.
Am I missing some thing?
You can use a product like Twilio Conversations for that purpose. You add both as participants into a conversation. They communicate to each other via their assigned Twilio Proxy numbers.
Introducing Twilio Conversations: Now, every message becomes an invitation for a conversation
Using Twilio Conversations (Using Conversation You Tube Video - Signal 2019)

twilio stop receiving messages

We are using twilio service to send messages to our customers. We want to provide STOP receiving messages option to our customers.
So when a customer replies STOP, he/she should stop receiving messages. I think twilio has a blacklist to stop sending messages to a customer if the customers chooses to.
However, as an organization, we also want to know if a customer opted out of receiving messages.
How will twilio tell us that a customer opted out of receiving messages? How can we add a web hook such as a rest endpoint in twilio? Is this usecase possible in twilio?
Twilio evangelist here.
This article explains our default keyword handling: https://support.twilio.com/hc/en-us/articles/223134027-Twilio-support-for-opt-out-keywords-SMS-STOP-filtering-
tl;dr If someone texts STOP to your Twilio number we add them to our blacklist then pass the message on to you via the normal webhook process.
Hope that helps.

how to check Twilio Web Client online from twilio php REST

The scenario is - A twilio web client 'Mr TWC' and A customer 'Mr 123'.
Now I need to respond 'Mr 123' based on 'Mr TWC' in online on a web browser OR offline/not on a web browser.
Thanks In Advance
Twilio developer evangelist here.
I'm afraid there's no way to check the status of Twilio Client users via the REST API.
There used to be presence events available on the Client, but this was deprecated in version 1.3. So, I recommend you keep track of whether your users are online yourself. You could do so by maintaining a list of online users in something like redis on your server. Every time a user successfully authenticates and starts listening for incoming calls with Client, send an Ajax request to your backend to add their username to the list. Then, when they go offline, or close the browser you can send another request to remove their name from the list.
Let me know if that helps at all.

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

Resources