Showing Read At for Twilio Programmable chat - twilio

I'm using Programmable chat. I'm trying to show ReadAt meta data to users. I know when the user is getting the message on the frontend since I'm listening to messageAdded on the current Channel in the Twilio Javascript SDK. I'm storing the message by listening to Webhook on the preMessageSend to make sure that the message is saved in DB. When I get this message, the problem is I'm not getting the messageId which I'm getting on the Javascript SDK message. Can someone help me in understanding how to correlate both the messages?

According to the Twilio developer docs:
Pre-Event Webhooks will fire before an action has been committed to the Chat instance, blocking publication until a response is received. This gives your backend (or Function) the opportunity to intercept, modify, or reject any action across the instance, making these hooks useful for spam/language filtering, complex permission schemes, or other business logic. Pre-event webhooks are fired only for actions from the Chat SDK; the REST API actions will never fire them.
So I suspect the messageId is not created until after this webhook.

Related

How to track different conversation threads between 2 participants in twilio?

I have an application which uses Twilio to send SMSs.
There is a situation where the application sends multiple messages to a person, for example a message with info about product P1, then another message with information about product P2, and so on. So my question is, when the person replys the SMS, how could I know to exactly what SMS he is replying?
Or is it possible that each SMS that my application sends to the same person creates different conversations in Twilio, so I can track each response per each different SMS?, if so, how I can do it?
If you trigger the SMS messages by API it's hard to know what messages the customers answer.
We got to solve this problem using Twilio Sync (https://www.twilio.com/docs/sync/api/document-resource) which is basically cloud storage, so when we need to trigger an SMS or Whatsapp message, we save some information on Twilio Sync, like Twilio number, client number and the messages that were sent.
When the customer answers the message, we send him to a Twilio Studio that runs a Function that read the Sync document and check if this customer comes from a message response, if yes, we get the triggered message and added on the conversations, so we know the message that customer answered.
The Sync isn't a database and has a limit, so depending on your message volume, it can not work well.

How to subscribe twilio number's error messages?

I have a Twilio account with a several numbers, and I have a Java back-end with Postgres DB. Is it possible to subscribe with twilio-api to get errors of this numbers on the date or in real time?
The best way to capture SMS errors such as Error 30005 Message Delivery - Unknown destination handset, and other 3000x errors is using Message Status Callbacks. You can find more details below. It is an additional URL you point Twilio to when making a request to the /Messages resource. These types of errors don't appear in the debugger because they can be quite a few of them, based on the customers use case. The new Message Insights tool allows you to visually filter on these errors from the Twilio Console (but there is no API).
A way to mitigate 30005 errors is using the Twilio Lookup API, to confirm the number is a mobile number and capable of receiving an SMS before sending the message.
Track Delivery Status of Messages

How can we track the message status ( like queued,sent,delivered etc ) using twilio studio workflow

I was using Twilio's sms api to send sms and i was able to track the delivery status using status call back url.But currently am planning to switch my implementation to twilio studio workflow but i didn't find a status call back functionality in it.
please help?
Twilio developer evangelist here.
The Twilio Studio send message widget has two transitions, one for if the message was sent successfully and one if the message failed to send. It's not quite as nuanced as the statuses you can get callbacks for, but that is what is available. The send and wait for reply widget also has a transition for delivery failed.
Are these enough for your application?

How to make Incoming SMS via Twilio Appear and Generate Notifications in Bitrix

Hi I've integrated Twilio with Bitrix and am able to send outgoing sms that do reach the receiving number, but the incoming reply texts do not appear on the contact profile or generate notifications. To summarize, I need help making incoming sms appear in contact profiles and generate notifications for all/most employees.
I heard one method was to use Bitrix24 webhook for authorization and API REST for data. If this method works then I need a step-by-step on how to do it.
I have limited coding experience.
I've tried generating a Bitrix webhook and setting that as the incoming URL for the text messages in Twilio but the replies still did not appear.
Thanks.

Using Twilio Chat on iOS, is it possible to send a small amount of custom non-message data between users?

We have an app built with Twilio Chat for iOS and everything is working very well. However, we now have a requirement to invite the other chat participant to join a video room, and we would like to send the invite signal through the Twilio Chat channel that is already established (similar in functionality to the Typing signal.)
I know Push Notifications are supported by Twilio Chat, but that seems like overkill for this use case, where a simple signal is all that's needed.
What is the easiest way to send a very small amount of non-message data between Twilio Chat channel participants?
Twilio developer evangelist here.
When you send a message with Twilio Chat you can also set an Attributes field which can contain JSON. You can then use this to signal that the message is not for printing on the page, but a service message or invite. You will then need to updated your UI to read the attributes of a message and decide whether to display it or use it to create the Video chat.
Let me know if that helps at all.

Resources