Forrest Mahannah
Forrest Mahannah

Reputation: 11

How to specify SMS URL for specific text message

Is there a way when using the REST API to send an outgoing message that I can specify the SMS Url to use for any responses to that message? I saw mention of it in the docs where it says you can specify it for the phone number in the console or via the API. If I post a variable named SmsUrl when sending the text it still uses the url connected to the number or the twilio app.

We need responses to submit back to a url on our server that includes a parameter that lets us connect the response to a specific inspection request. In other words we need to be able to connect the response not to the from number but to the record on our end for which the outgoing message was triggered.

Thanks

Upvotes: 0

Views: 1589

Answers (1)

miknik
miknik

Reputation: 5951

If you are sending from a single number this is totally impossible, SMS simply doesn't work like that. If you send me 5 SMS and then I reply to one of them my reply contains no data which links it to the SMS I am responding to.

The only ways I can see you achieving this are:

  • Assign a different outgoing number to each trigger. This is foolproof but may not be viable depending on your usecase and nuber of triggers. It may also confuse your users if they get texts from many different numbers, although if you buy consecutive ones you could mitigate this.
  • Include instructions in your SMS like "Reply 1 to request a call, 2 to request a password reset..." or "Start your reply with XXXX" where XXXX is a unique code you generate server side and assign to the user, or have a code for each trigger or whatever. This would work
    with only one outgoing number, but in my experience the end users will screw it up a lot of the time and not respect your instructions.

Upvotes: 1

Related Questions