0

Is it possible to include a custom field in the Twilio SMS message that will be persisted in Twilio and be included in the call back?

We have a requirement that prior to sending an SMS to Twilio, we check that the message hasn't already been sent. Currently we persist the returned MessageSid and check that. The issue is that occasionally the Twilio API doesn't respond in the allotted time and we don't have the MessageSid to persist and check.

Ideally we would include a custom field in the SMS message that we can check in Twilio prior to sending.

Any suggestions are greatly appreciated.

DarkBee
  • 16,592
  • 6
  • 46
  • 58
Richard Butterwood
  • 735
  • 1
  • 12
  • 29

2 Answers2

1

Twilio developer evangelist here.

There is not a custom field that can be added to a Twilio SMS message, all the properties of a message can be seen in the message resource documentation.


Perhaps you can explain more about what is causing your issue here? Why might you try to send the same message twice and need to perform this check? And why might a slightly slower API request cause that system to fail?

philnash
  • 70,667
  • 10
  • 60
  • 88
  • We are using an Azure Function (Service Bus Trigger) to send the message. Occasionally the function dies/times-out before we receive a response back from Twilio. When the function dies, it dead letters the message which we then re-try. To stop duplicate text messages, we need to check if the message was already sent – Richard Butterwood Feb 23 '22 at 14:02
  • I am concerned about your Functions dying like that. Is there a very strict timeout on them? Typically I don't find requests to Twilio to send a message take that long to respond. Is there something in the code causing this? – philnash Feb 23 '22 at 23:00
0

I found ClickSend SMS API very powerful as it allows to add custom templates and fields. You can checkout the link here https://try.clicksend.com/au/sms-api/#

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 03 '22 at 06:34