One-time passwords (OTPs) contain numeric or alphanumeric codes that are used to provide an extra layer of security for your applications, by ensuring that a user is authenticated for a particular transaction or a login session. In this tutorial, we’ll be building a simple Flask application that generates and validates OTPs that are delivered to users via Voice or SMS channels using Twilio.
To follow along, you’ll need the following:
- A free Twilio Account. If you use this link to register, you will receive $10 credit when you upgrade to a paid account.
- Python 3.6 or newer.
- A phone line that can receive voice calls and/or SMS.
Creating a Python environment
Let’s create a directory where our project will reside. From the terminal, run the following command:
$ mkdir twilio_otp
cd into the project directory and run the following command to create a virtual environment.
Are you a developer looking for a new hobby that’s compatible with sheltering in place? Would you like to be able to share it with friends from a virus-safe distance?
You can stargaze from the safety of your own lawn, balcony, or roof, and you don’t need any equipment other than your own eyes, and maybe a pair of binoculars. There are plenty of bright objects in the night sky that are visible with the naked eye. One of them is the International Space Station (ISS), which is the third brightest object in the sky after the sun and moon.
The ISS whips around the earth at 27,576 kilometers per hour (17,000 miles per hour), making a complete orbit every 94 minutes. Opportunities to observe it only last a few minutes, so it’s helpful to know when the ISS will be visible and from which direction it will appear.
An SMS survey allows you to engage your audience remotely, so that you can access valuable customer feedback in real time. In this post, we will build a simple SMS survey using Twilio Studio. Your respondents can text a phone number, receive any series of questions or statements via text, then your app will validate their responses and log them. No coding required.
In order to complete this tutorial you will need the following:
- A Twilio account. If you don’t have one yet, you can use this link and get an extra $10 in Twilio credit when you upgrade.
- A Twilio Phone number. You can follow this short how-to on purchasing a number if you do not already have one.
Build an App with No Code in Twilio Studio
Twilio Studio is a drag-and-drop editor that allows you to build Twilio apps and host them in the cloud. …
In the age of impending climate catastrophe, it is important now more than ever to respect the rights and sovereignty of Native people worldwide. Recognizing the traditional stewards of the land by making land acknowledgements at events or gatherings is a vital first step towards inserting an awareness of Indigenous presence and land rights into everyday life.
This kind of thing has been becoming a bit more commonplace at developer conferences such as JSConf US and PyCascades.
Using Native Land Digital, an Indigenous-led, in-progress project dedicated to helping people learn more about their local traditional Indigenous territories, I created a text messaging bot for people who are on the go to quickly find out which Native territory a given address exists on.
Try it by texting an address to +1 (331) 244-LAND (+1 331 244 5263).
By texting "101 Spear Street" for example, we can see that …
Kristen Womack may not be a traditional developer. She didn’t dream of building computers as a kid and she didn’t pursue a computer science degree. In fact, she studied sign language interpretation and linguistics in school. But, she is driven by something that fuels developers across the globe: “the hacky nature of wanting to make something work.” This nature has enabled her to use software and technology as the building blocks for her dreams.
Her career spans a number of roles in the tech stratosphere. As a Technical Product Manager at Best Buy, she first learned about Twilio. She found her “curiosity about API strategy wouldn’t end” and Twilio stood out to her as one of the companies with the best API documentation.
Email is a critical part of any business communication strategy, both internally and externally. Today the need to have dynamic, content-driven, responsive email campaigns is critical. Twilio SendGrid allows organizations to deliver on this need with a highly performant and customizable CRM that works well in both the GUI and programmatically via API.
In this tutorial, we’ll set up a free SendGrid account and, using Python, send ourselves both simple text/html emails as well as high-res, dynamic content. We’ll also retrieve sending data like the number of emails sent, how many were opened or clicked, if any bounced, etc.
By the end of the tutorial you’ll be able to:
- Set up a free SendGrid account and API key for interacting with the service
- Set up a Python application that calls the SendGrid Web API v3, sends emails to different lists, and retrieves statistics about those sends
- Start working with …
npm i twilio
SPREADSHEET_ID= STAFF_WORKSHEET_ID= SHIFT_WORKSHEET_ID= TWILIO_ACCOUNT_SID= TWILIO_AUTH_TOKEN= TWILIO_STUDIO_FLOW_SID=
Twilio Studio REST API v2を使ったフローの取得と更新
今回利用するTwilio Studio REST API v2は4月末にパブリック …
Serverless applications are applications that are built, deployed, and then executed on-demand. The servers on which they run are provided by the cloud platform to which they are deployed, and the developer only needs to focus on writing the code.
The on-demand aspect ensures that the developer is only charged for execution time, as opposed to being charged for a fixed amount of bandwidth or a specific number of servers.
Bref is an open-sourced project that lets you create and deploy serverless applications, called functions, to AWS Lambda using PHP. It integrates with the Serverless Framework which abstracts the operations involved in deploying and monitoring such applications.
In this tutorial, you will be building a webhook for the Twilio Console Debugger that gets triggered when there is an error with (any of) your Twilio application(s) and send the payload to Slack.
To follow along, you will need:
- PHP 7.2 …
Twilio Autopilot makes it easy to build conversational bots that provide information to users in a highly engaging and intuitive format. A single Autopilot bot can be deployed on several channels including SMS, Voice, WhatsApp, Slack, Alexa and more.
In this tutorial we are going to build a bot that provides COVID-19 stats for all countries using a purely conversational style. We will train the bot with example sentences to help it extract meaning from the freeform text entered by the user. Once you learn how this specific bot works, you will be able to adapt it to other data sources.
The aspects that make this bot interesting that I’d like you to notice are:
- The user makes requests in an informal and conversational tone. Autopilot makes it very easy to “teach” the bot how people ask questions using freeform language, and how to extract the actual information embedded in …
Quest'articolo è la continuazione del precedente interessantissimo articolo, in cui Dominik descrive come costruire un sistema per ordinare caffè usando Autopilot. Al momento, Twilio Autopilot supporta solo la lingua inglese, esploreremo quindi come implementare il sistema per ricevere ordini sia in inglese che in italiano.
Se non avete ancora il vostro account Twilio, seguite questo link per crearne uno gratuito. Ci vogliono meno di 2 minuti!
Nel vostro account Twilio useremo:
- Twilio Programmable Messaging per inviare / ricevere messaggi tramite WhatsApp
- Twilio Autopilot per l'interpretazione dei messaggi in inglese
- Twilio Runtime per gestire il flusso dei messaggi
Inoltre, avrete bisogno di un account per Google DialogFlow e Google Cloud platform.
Diagramma di funzionamento
Il flusso che andremo ad implementare è il seguente:
Vediamo i passi nel dettaglio:
- Il cliente invia un messaggio tramite WhatsApp
- Appena Twilio riceve il messaggio, vengono invocate le API di Google …