https://paired-sms.herokuapp.com
-
Clone this repo on to your local machine.
-
Navigate into your repo via the command line.
-
Install Python 3.8 and pip if you have not already done so.
-
Create a virtual environment by entering the following commands:
$ pip install virtualenv
$ virtualenv venv
$ source venv/bin/activate
-
Install dependencies by running requirements.txt:
pip install -r requirements.txt
-
Add your Twilio API key to your environment variables
-
Enter
flask run
in the terminal to start up your server. -
The endpoint for all message requests is
/request
. Send a POST request using the tool of your choice tolocalhost:5000/request
. The body of your request should be formatted as follows:{ 'phone_number': '3035559823' 'message': 'Hello! This is a text message' 'sms_token': 'YOUR SMS TOKEN' }
The recipient's phone number must be in the exact format as in the example above. The sms token is a secret token that must be valid in order to use this service. Contact the owner of this repo if you would like to request a token.
- If the request is processed with no errors, the response will look like this:
{'response': 'success'}
- If Twilio cannot send the message, the response will look like this:
{'response': 'twilio error'}
- If your request is not valid, the response will look like this:
{'response': 'Invalid request'}
- Send a POST request to https://paired-sms.herokuapp.com/request using the same method described above.