Two-Way SMS: Surveys, Polls, Autoresponders and Chatbots

Using 2-Way SMS to Create Surveys

Table of Contents

Two-way SMS lets customers reply to your texts and lets your systems receive and act on those replies, so a message becomes a conversation instead of a broadcast. It works by sending from a number that can receive messages, such as a rented virtual mobile number, and forwarding each reply to your application by webhook, where you can record a survey answer, send an automatic response or pass the thread to a person.

This guide explains how inbound messages reach your app, then covers the four common uses: surveys and polls, keyword autoresponders, confirm-by-reply flows and chatbots. You can see the underlying two-way SMS and long code features on our features page.

What is two-way SMS and how is it different from one-way?

Most marketing and notification texts are one-way. They are sent from an alphanumeric sender ID, such as a brand name, and the recipient’s phone has nowhere to send a reply. Two-way SMS uses a real number instead.

One-way SMSTwo-way SMS
Sender shownBrand name (alphanumeric) or a numberA virtual mobile number, toll-free number or short code
Can the customer reply?No, with an alphanumeric senderYes
Typical usesOffers, alerts, passcodesSurveys, bookings, support, keyword campaigns, opt-in and opt-out by keyword
What you needA sender ID allowed in the destination countryA rented number where two-way is available, plus a webhook to receive replies

Availability depends on the country. In some markets you can rent a local mobile long code; in others two-way traffic runs over toll-free numbers or a short code, and in the US business traffic on local numbers must be registered as 10DLC (see our comparison of 10DLC, short codes and toll-free numbers). Check the number options for each country before you design a flow around replies.

How do replies reach your application?

On SMS.to the flow has four steps:

  1. Rent a virtual number. The number can be your sender for outgoing texts and receives every reply.
  2. Set your inbound webhook. In your account settings, under Webhook Management, enter a Default Inbound Callback URL.
  3. Receive each reply. When a customer texts your number, SMS.to sends an HTTP POST to that URL with the fields described in our inbound message callback documentation: from (the customer’s number), to (your rented number), message (the text), parts and receivedDate (ISO 8601).
  4. Respond quickly. Your endpoint must return HTTP 200 within four seconds. If it does not, the connection is closed and the callback is retried after an hour, so do slow work in a background job rather than inside the request.

If you cannot expose a public webhook yet, you can poll GET https://app.sms.to/v1/recent/inbound-sms, which returns messages received on your rented number in the last hour. Webhooks are the better choice for anything interactive, because the customer expects an answer in seconds.

Here is a minimal Python (Flask) handler that reads a reply, handles an opt-out, records a yes or no answer and sends an automatic response from the same number:

import requests
from flask import Flask, request

app = Flask(__name__)
API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
STOP_WORDS = {"STOP", "END", "CANCEL", "UNSUBSCRIBE", "QUIT"}

def send_sms(to, sender_id, text):
    requests.post("https://api.sms.to/sms/send", headers=HEADERS, timeout=2,
                  json={"message": text, "to": to, "sender_id": sender_id})

def save_answer(phone, answer):
    pass  # store the answer in your own database

@app.route("/sms/inbound", methods=["POST"])
def inbound():
    customer = request.form.get("from")
    our_number = request.form.get("to")
    word = (request.form.get("message") or "").strip().strip(".!").upper()

    if word in STOP_WORDS:
        requests.post("https://app.sms.to/v1/people/contacts/optout",
                      headers=HEADERS, timeout=2, json={"phone": customer})
        send_sms(customer, our_number, "You are unsubscribed and will get no more texts from us.")
    elif word in {"1", "YES", "Y"}:
        save_answer(customer, "yes")
        send_sms(customer, our_number, "Thanks, your booking is confirmed.")
    elif word in {"2", "NO", "N"}:
        save_answer(customer, "no")
        send_sms(customer, our_number, "No problem, we have cancelled it. Reply HELP for options.")
    else:
        send_sms(customer, our_number, "Sorry, we did not understand. Reply 1 to confirm or 2 to cancel.")
    return "", 200

In production, put the outgoing calls on a queue so the webhook always answers inside four seconds, and keep your API key in an environment variable rather than in code. Full request options are in the SMS.to API documentation.

How do you run surveys and polls by SMS?

SMS surveys work best when each message asks one question that can be answered with a number or a single word. A typical flow:

[Brand]: Thanks for visiting today. How likely are you to recommend us to a friend? Reply with a number from 0 (not likely) to 10 (very likely).

  • Validate every answer. People type “8”, “eight”, “8/10” and “8 thanks”. Strip punctuation and words, and send a short retry prompt if nothing usable remains.
  • Branch on the answer. A low score can trigger a follow-up question (“What could we do better?”) or an alert to a manager; a high score can trigger a review link.
  • Stop at two or three questions. Completion falls with every extra message.
  • Time it well. Send within a few hours of the visit, delivery or call you are asking about.

Opinion polls follow the same pattern, with answer options mapped to numbers (“Reply 1 for Monday, 2 for Wednesday”). Keep polls honest. In the UK, the ICO’s guidance on opinion research and direct marketing says genuine research is not direct marketing, but messages that use a survey as cover for selling, fundraising or campaigning are, and then need marketing consent.

How do keyword autoresponders work?

A keyword autoresponder replies instantly when an incoming message matches a word you have defined. It is the simplest two-way feature and covers a surprising amount of customer contact.

KeywordAction
JOINAdd the number to a marketing list and send a confirmation with frequency and opt-out details
STOP (and END, CANCEL, UNSUBSCRIBE, QUIT)Opt the number out, send one confirmation, then nothing more
HELPReply with who you are and how to contact support
HOURS or INFOReply with opening hours, address or a link
1 / 2, YES / NOConfirm or cancel a booking, delivery or appointment
Anything elseA short fallback that lists valid keywords, or a hand-off to a person

Match keywords without regard to case or trailing punctuation, and treat common variants the same way. A JOIN reply is a clear opt-in if your poster or pack says what people are signing up for, so send a confirmation straight away:

[Brand]: Welcome! You’ll get up to 4 texts a month with offers and news. Reply HELP for help or STOP to opt out at any time.

Out-of-hours autoresponders are useful too: if a customer texts your support number at night, reply with the time you open and a link to self-service answers, then queue the thread for the morning. For opt-out wording, consent records and local rules, see our guide to SMS marketing compliance.

How do confirm-by-reply flows cut no-shows?

Reminders that ask for a reply turn a notification into a decision. A clinic, salon or restaurant sends “Reply 1 to confirm or 2 to cancel”, marks confirmed bookings in its calendar, and releases cancelled slots to a waiting list, often by texting the next person on it. Delivery firms use the same pattern to confirm that someone will be in. Our guide to SMS appointment reminders covers timing and wording.

Can you build a chatbot over SMS?

Yes. An SMS chatbot is your inbound webhook plus a record of where each customer is in the conversation. Because every reply carries the customer’s number in from, you can key the conversation state on it and decide the next message from the last one.

  • Start with structured flows. Order status, booking changes, store finders and FAQs work well as short, guided menus.
  • Add language understanding where it helps. A natural-language model can interpret free text, but keep answers short: every reply over 160 characters, or over 70 with emoji, costs another message part.
  • Always offer a person. Let customers reply AGENT at any point and route the thread to your support team or CRM.
  • Say it is automated. Customers trust a bot that is open about being one.
  • Keep sensitive data out. SMS is not end-to-end encrypted, so never ask for passwords or full card numbers by text.

Send bot replies from the same number the customer wrote to. A reply from a different sender breaks the thread on the customer’s phone and looks like spam.

How SMS.to handles two-way SMS

Everything above runs on the same SMS.to account you use for one-way messaging:

  • Virtual numbers to rent, used as your sender ID or to collect replies, with toll-free and short code options in some markets. Contact your account manager for the options in each country.
  • Webhooks for replies and delivery reports, so answers reach your app or CRM in real time.
  • Contacts API to opt numbers in or out when they text a keyword.
  • Team members under one account, each with their own access level and sending credits.
  • Shortlinks with click tracking, for surveys and bots that point people to a page.

See all the SMS.to features for 2-way SMS, long codes and short codes.

FAQs

Can customers reply to a text sent from a brand name?

No. Alphanumeric sender IDs are one-way. To receive replies, send from a rented virtual number, a toll-free number or a short code.

How do I receive SMS replies in my app?

Set a Default Inbound Callback URL in your SMS.to account. Each reply is posted to it with the sender, your number, the message text and the time received.

Do customers pay to reply?

Replies are normally charged at the customer’s standard messaging rate or taken from their bundle, depending on their tariff and the number type. Avoid premium-rate numbers for replies, and check how your number type is charged in each country.

Is two-way SMS available in every country?

No. Number types and two-way support vary by country, and some markets require registration. Check availability before you launch a reply-based campaign.

Want to try it? Create a free account, no credit card needed, rent a number and point its inbound webhook at your test endpoint.

author avatar
Marios Italos

More Articles

Firmao is a cloud-based, all-in-one business system covering CRM, invoicing and tasks. Here is what
A step-by-step guide to SMS marketing: getting consent, choosing a sender ID, writing and personalising