Twilio Studio: send response message based on incoming message content - twilio

I already have a Twilio application with this use case :
The incoming message is forwarded to a client
The client replies to the message by sending a message to the twilio number. The message body will contain the phone number at the beginning followed by the message content.
The web hook checks if the message is received from the client and it contains a phone number. If so, it forwards the message to the phone number in the body.
I would like to implement this use case using Twilio studio.
Is this possible?

You can use the Split widget and use a regular expression to test whether the input from Step 2 contains a phone number or not.

Related

WhatsApp chats real time recording

I have requirement from compilance to backup my business WA users chats (for reasonable price...)
Ive googled a lot and seems (correct me if Im wrong) only solution is to build own chat app (or use app delivered by API provider)
I've checked eg twilio, 360dialog, chat-api
I played a bit witch twilio and I know how to save incoming messages (sent by eg client), but not outgoing (sent by my users)
Also I know how to send WA msgs from my own app (so I can record those)
But my preference would be users to use WA on mobile phones or WA web and listen some hooks to record that.
Any idea how to implement that? Maybe WA buisness API can do that?
There is no straight way to do this using WhatsApp Business APIs,
You need to record both the messages in one place/table/collection whether it is sent from our business phone number or received from the clients/users.
We can do it but have to use proper logic, let's see both the scenario and how to record it in one place/table/collection,
Send Message from WhatsApp Business API (from our business phone number) to clients/users:
You can record the message whenever Business sends any message to clients/users because Webhook does not give that sent message content, yes it will notify us about status updates like sent, delivered, read, failed, etc.
Things we can record:
Message ID (This is important, you will get in response whenever we send a message from Business API)
From Phone Number (Business phone number)
Message Content
To Phone Number (Client/user phone number)
Message Status (sent, read, delivered, failed)
Sent Date
Updated Date (updated message status date)
Type (from business)
Receive Messages from clients/users to our Business Phone Number:
You can get message content from Webhook, so we can record that received message content object in our table/collection,
Things we can record:
Message ID (This is important, Get in Webhook)
From Phone Number (Client/User phone number)
Message Content
To Phone Number (Business phone number)
Message Status (sent, read, delivered, failed)
Sent Date (message received date)
Updated Date (updated message status date)
Type (from user/client)
Other Things that I am not sure about:
We can't get message content If a Business phone number sends a message to a client/user from WhatsApp Business App.

How to obtain final STATUS from a text sent to mobile phone

I am sending a text to a mobile number (US phone number) using the Programmable Messaging Quickstart for C# with .NET Core example. The message is sent and received successfully but the STATUS in the response shows "queued".
Is there a sample callback in C# to obtain the final status after the text is sent?
You have 3 options, either of the first two are suggested.
Subscribe to statusCallbacks, which will alert your application of the delivery status of the send message.
Use Event Streams to subscribe to specific message delivery event types (this option provides the ability to select different types of message delivery events).
Less efficient and not very scalable, make a request to the /Messages endpoint to determine the final disposition of the sent message (via its unique message SID).
Best Practices for SMS Message Logging

Between operator transfered phone numbers not receiving sent sms by twilio where UNDELIVERED status is RETURNED

In Morocco we have 3 operators:
=> IAM, INWI and ORANGE
=> My personal phone number was originally purchased from IAM operator then i have transfered it to INWI (and this is the problem)
I am integrating Twilio in my software and have made some tests and observed this when sending a new sms to someone :
- If the phone number is normal (not transfered as in my case) the SMS is delivered correctly
- If the phone number is transfered from an operator to an other as in my case the SMS is not Delivered
Am i missing any config or something ?
I am testing with postman via post http call to Twilio REST API url :
https://api.twilio.com/2010-04-01/Accounts//Messages.json

(Error: 30004) Message blocked. The destination number you are trying to reach is blocked from receiving this message

i got this message while i am trying to send sms with twilio. i never blocked any number
In my case it happened for an Indian number. For Indian number it could be blocked by the end user -
Limitations sending SMS messages to Indian mobile devices
SMS messages entering into India are categorized as “Transactional” or “Promotional” and may result as an "Error - 30004".
By default, all SMS messages sent from Twilio phone numbers are categorized as “Promotional” and are subject to the following limitations:
They cannot be sent to any phone number in India’s Do Not Call Registry
If you’ve been having trouble sending SMS messages to an Indian number, see if that number is registered on the National Do Not Call Registry.
If the owner of the phone number wishes to start receiving SMS messages from Twilio, they can update the DNC settings by following the instructions on this website.
More details : https://support.twilio.com/hc/en-us/articles/223134167-Limitations-sending-SMS-messages-to-Indian-mobile-devices
Twilio developer evangelist here.
Error 30004 doesn't mean that you blocked a number, but that the number you are trying to send to has blocked messages from your number. They could have done so by texting "STOP," "CANCEL" or other particular words to your number.
If you don't believe that this has happened, then I recommend you get in touch with Twilio support with the number that is causing this error and they will look into it.

Twilio Copilot - Will Sticky Sender Create a Mapping If The First Message Is Received By One of My Numbers?

When you are using Twilio Copilot, the service will create a mapping of which one of your numbers was used to send messages to a particular target phone number - and based on this mapping, always only send to the target phone number with the same Twilio phone number.
Will Copilot do the same thing if the first message is sent by a target phone number to one of my Twilio numbers?
For example, if 123-456-7890 (number belonging to my customer) sends a message to 999-999-9999 (one of my Twilio phone numbers), I want to ensure that every message I send to this customer going forward originates from 999-999-9999 and not any of my other Twilio numbers.
A mapping wouldn't be created by sticky sender if the first text exchanged between you and the non-Twilio number is sent by the non-Twilio number
Sticky sender will only work as you've probably read:
This mapping is created after the first message is sent from your
Messaging Service to a particular recipient.
Furthermore, there is not currently a way to intercept the Messaging Service to specify an initial number that you would like to send from.

Resources