1
votes

When using Twilio Programmable Chat channel's 'sendMessage' method to send a message what is the best way to immediately retrieve the newly created message's sid and timestamp?

The promise it returns does not contain these values. I have a use case where I need to persist these messages in a separate data store and I need to track their original sid, index, and timestamp.

1

1 Answers

1
votes

Twilio Developer Evangelist here

Using the JavaScript SDK you could use the Channel class which has a lastMessage property. The lastMessage consists of the sid, author and timestamp.

Here is a link to the documentation for the Channel class.

I hope that helps.