Search code examples
apismsvonage

Nexmo autoreplay on income sms


Is there any option to auto replay on income SMS or send automatically replay for example "SMS not delivered" or something like that? For example, the app sends some customer SMS and he replays on that number. We do not want to get income SMS from customers on that number because it is a virtual number.


Solution

  • You would need to set up a webhook that forwards the SMS to an application, and that application can respond with an appropriate error message. Examples on how to process a request can be found at https://developer.nexmo.com/messaging/sms/code-snippets/receiving-an-sms

    You can do this in two ways. One is to edit the number directly and set an "Inbound Webhook URL". Log into your dashboard, go to "Numbers", and then click the pencil/edit icon next to the number you are sending from. You can then fill in the URL that is listening for SMS messages under "SMS".

    The second option is to set a fallback URL for all SMS messages. This is done by going to your account Settings page, and then filling in the "Inbound messages" box under "Default SMS settings". This URL will then forward any SMS to the webhook URL on any number that does not have a bespoke webhook assigned.