For that, we recommend using ngrok, which exposes local servers behind NATs and firewalls to the public internet over secure tunnels. You should then be able to see your basic server app in action on That’s fine for testing, but it’s not much good if you can’t connect to the internet to receive incoming messages and handle callbacks. "Message received - From: %s, To: %s, Text: %s" % (from_number, to_number, text) Then create a file called receive_sms.py (or whatever name you like) with this code in it: from flask import Flask, request When someone sends an SMS message to a Plivo phone number, you can receive it on your server by using a Flask web app.įirst, optionally, set up a virtual environment to keep these packages isolated from others on your system. Plivo supports receiving SMS text messages in many countries (see our SMS API coverage page, and click on the countries you’re interested in). Of course sending messages is only half of the equation. You can verify a phone number using the Sandbox Numbers page of the console. Note: If you’re using a Plivo trial account, you can send messages only to phone numbers that have been verified with Plivo. Replace the placeholders auth_id and auth_token with actual values from the Plivo console, and use your own source and destination numbers. You can send an SMS message with just a few lines of code: import plivo You can learn more about the use of alphanumeric sender ID and register one from the Plivo console. For messages to countries other than the US and Canada, you might want to register an alphanumeric sender ID for your messages. You can also rent numbers from this screen.Ĭarrier SMS regulations vary from country to country. Check the Numbers screen of the Plivo console to see what numbers you have available and which of them support SMS capabilities. You need an SMS-enabled Plivo phone number to send messages to the US and Canada due to the carrier regulations imposed by those countries. We provide an Auth ID and Auth Token in the Account section at the top of the Plivo console. You have to have proper credentials before you can use the Plivo API. If you prefer to install from source code, visit our Quickstart Guide for instructions. Installing the Plivo SDK is as simple as running We’ll presume you already have Python installed. Let’s see how to send and receive messages through Plivo in a Python application. Don’t worry - Plivo has an SDK to help you out. Your company has settled on Plivo to handle its voice and messaging communications, and now it’s your job to start integrating Plivo into your company’s applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |