Reply to Incoming SMS
When an SMS is sent to an Plivo phone number, you can receive the text on your server by setting a Message URL in your Plivo app. Plivo will send the message along with other parameters to your Message URL. You can reply back using the Plivo Message XML.
- Sign up for a free Plivo trial account.
- Check out our server SDKs page and install the right helper based on the programming language you want to use.
- A phone number is required to receive and reply to SMS text messages. You can buy a Plivo phone number in over 19 countries through the Buy Numbers tab on your Plivo account UI. Check the SMS API coverage page for all the supported countries.
- Use a web hosting service to host your web application. There are many inexpensive cloud hosting providers that you can use for just a few dollars a month. Follow the instructions of your hosting provider to host your web application.Note: If you are using a Plivo Trial account for this example, you can only send sms to phone numbers that have been verified with Plivo. Phone numbers can be verified at the Sandbox Numbers page.
Set up a Web Server
Let’s assume your web server is located at
http://example.com. Below is a snippet to set up a route on your webserver. Now when we send an HTTP request to
http://example.com/reply_to_sms/ this route will be invoked.
- Copy the relevant code below into a text file and save it. Let’s call it,
- Customize the
'body'with your reply.
- Next, you will now have to configure this URL in your Plivo application.