This post will guide you through the steps on how to send SMS messages with Python and Twilio. We will use talaikis.com
API to get a random quote that we will include in the body of the sms.
Signup for a Trail Account:
Sign up for a trail account at Twilio then create a number, which I will refer to as the sender number
, take note of your accountid and token.
Create the Config:
Create the config, that will keep the accountid, token, sender number and recipient number:
1 2 3 4 5 6 |
|
Create the Client:
We will get a random quote via talaikis.com’s API which we will be using for the body of our text message, and then use twilio’s API to send the text message:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Message Preview:
Then within a couple of seconds your message should look something more or less like this:
For more info, have a look at their docs: - https://www.twilio.com/docs/