#100DaysOfWeb in Python Transcripts
Chapter: Day 51: Twilio
Lecture: What did we learn?

Login or purchase this course to watch this video and the rest of the course contents.
0:00 And that was the super simple Twilio API. You've probably watched all of these in one day. Let's breeze through this. Sending an SMS with Twilio.
0:11 What we did was, we imported the client function from Twilio.rest. We then specified our account SID's and authentication tokens.
0:21 Now these could be specified in an OS variable or an OS environment variable but you can probably just hard code if no one's going to look at this
0:31 just for this simple exercise. Next, we used our client function to take the account SID and the authentication token
0:41 and create ourselves a little client object and we use that object to create ourselves a message.
0:47 And finally within that message we had our two phone number which we had to make our own mobile because that was the number that was verified
0:56 with Twilio and then we had the phone number and our body. Now, moving onto this unverified phone number error. So if you tried to send a text message
1:09 to a number that you did not verify yourself you would receive this message on the command line as an error.
1:17 So, unable to create record. The number is unverified. Trial accounts cannot send messages to unverified numbers.
1:24 This is something I've mentioned before so what you would need to do is actually get that number verified. And that would mean letting that person know
1:32 and getting it on that page and you go from there. That is it. Your turn. Try and put something interesting in the body. Try to automate that.
1:43 So again, see if you can, if you're pulling data from web scraping or something like that and pop that into the body text field of our SMS and see
1:53 if you can text yourself something interesting. Again, keep calm and code in Python.

Talk Python's Mastodon Michael Kennedy's Mastodon