Code, Tutorials and Hacks
One-time passwords (OTPs) sent via SMS are often a great solution for helping people better protect access to their online accounts. However, it's not a perfect solution, because phones are vulnerable to SIM swap attacks.
A SIM swap attack happens when a malicious actor convinces someone working for a cellular phone carrier to link a user's phone number to a new SIM under their control. This SIM can be a physical or a newer embedded SIM or eSIM.
After the phone number is relinked, the genuine user loses control of their number. The malicious user is then able to receive all calls and SMS sent to the phone number, allowing them to receive any OTPs delivered via SMS.
Twilio now offers SIM swap detection through the Lookup API, which reduces the possibility of SIM swap attacks.
In this tutorial you will learn what SIM swap detection is and …
In this article, you will learn how to spin up a MySQL database and connect it to a Java Spring Boot project. You will also use Postman's desktop application to send requests to the application.
- Refer to this Twilio article to set up a Java Spring Boot application that can be hosted on the web.
- IntelliJ IDEA Community Edition for convenient and fast Java project development work. The community edition is sufficient for this tutorial.
- Java Development Kit (JDK) version 11.
- ngrok, also known as a handy utility to connect the development version of the Java application running on your system to a public URL that Twilio can connect to.
- MySQL is the database service you’ll use to store the employee data and access in your application through REST APIs. You can follow the guide for detailed steps to setup MySQL with MySQL Workbench.
- The MySQL command-line …
In a previous blog post, I showed how you can use Visual Studio dev tunnels to make your ASP.NET Core application publicly available and then use your public application to handle the Twilio SMS webhook.
In this blog post, you will learn how to retrieve the tunnel URL from your ASP.NET Core application and use it to automatically update the Twilio SMS Webhook, so you don't have to do this manually whenever the tunnel URL changes.
You'll need the following things to complete this tutorial:
- Finish the previous tutorial on Visual Studio dev tunnels and Twilio SMS Webhooks
- A Windows machine (there is no information about support for Visual Studio for Mac yet.)
- Visual Studio 17.4 or later, with the ASP.NET and web development workload installed
- In Visual Studio, you need to enable the dev tunnels preview feature
You can find details on how to do these steps …
Automation is essential to improving the efficiency of any process. By harnessing technology solutions for monotonous tasks, human resources are freed up for use in more intricate aspects of the process. An excellent example of this is automating notifications and reminders using phone calls.
In this article, I will show how to build a Go web application which, when provided with a phone number, will make an automated phone call to the provided phone number and play one of three pre-recorded audio files. But keeping with the spirit of the season the caller will be greeted with a spooky Halloween message.
To follow this tutorial, you need the following:
- A free Twilio account
- A Twilio phone number
- A phone that can make and receive phone calls
- A basic understanding of Go
- Go 1.19
Set up the project
The first thing you need to do is to create a …
Micronaut is a framework for building JVM web and serverless apps, first released in 2018. It aims for fast startup and low memory overhead for your web applications, and supports Java, Kotlin, and Groovy, with an eye on Scala support in the future.
You might be familiar with Spring Boot as a popular framework in this space, and Baeldung has an overview article comparing it with Micronaut.
In this post I'll show how to set up a web app with Micronaut to handle Twilio webhooks for incoming SMS so your app can reply to them automatically. If you're interested in starting your Micronaut journey or looking to learn enough to start building your next Twilio app with it, then read on.
- A recent version of Java. I used Java 18 but anything from 11 onward will work
- A Twilio account. Sign up here if you don't have …
With billions of users around the world and its lack of reliance on cellular networks, WhatsApp can be an important customer engagement channel for companies using Twilio Flex. But integrating Twilio Flex and WhatsApp might seem like a daunting task due to the amount of effort required to stand up the desired experience.
In this blog post, I will provide a quickstart checklist that walks through standard implementation steps between Twilio Flex and WhatsApp. Completing this checklist will help you build a scalable WhatsApp integration that effectively reaches your audience.
- Single or multiple Twilio accounts depending on the environment strategy (we provide some guidance around account setup below)
- Identity Provider and Single Sign-On
- Meta Business Manager ID (formerly known as Facebook Business Manager ID)
The following steps are not the only configuration options available, but they do cover most of the necessary implementation steps to have …
While stories of indigenous people were shared in my classrooms growing up, I never truly understood just how many groups inhabited (and currently inhabit) the land we now know as the United States of America. Curious about the scale of things, I took a look at Native Land Digital and their API and was amazed at how many recognized territories there were across not only North America, but across the entire world.
In honor of Indigenous Peoples’ Month, I built a simple mobile app that takes your mobile device’s geolocation and gives you details about the indigenous groups and territories that have been established near you. In this tutorial, you’ll learn how I built the app using Twilio’s WhatsApp API so you can discover indigenous groups and territories near you!
For this tutorial, you will need:
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate building, testing, and deploying your software projects. In this tutorial, we’ll be looking at how to conditionally trigger a GitHub Action workflow using Twilio’s Programmable SMS.
This is useful for situations where you want to trigger a build or deployment pipeline manually. In this case, all you need to do is send an SMS to your Twilio phone number.
To follow along, you’ll need the following:
- A free Twilio account
- Python Development Environment
- Ngrok. This will make the development version of our application accessible over the Internet.
- A GitHub account
Creating a Python environment
Let’s create a directory where our project will reside. From the terminal, run the following command:
$ mkdir twilio_github_actions
cd into the project directory and run the following command to create a virtual environment.
$ python …
Congress recently came out with an official API so the public can "view, retrieve, and re-use machine-readable data from collections available on Congress.gov!" Read on to learn how to read congressional data using the Congress API, Twilio Functions, and the Twilio Serverless Toolkit.
Text "bill", "amendment", or "summaries" to +12029337044 to receive data about a random bill or amendment!
- A Twilio account - sign up for a free one here
- A Twilio phone number with SMS capabilities - configure one here
- A Congress.gov API Key – get one here
- Postman (you could alternatively make cURL requests from the command line)
- Node.js installed - download it here
Make a congress.gov Requ …
OpenAPI is a specification for a machine-readable description of HTTP web services. If you have never heard this name, maybe you are familiar with Swagger, which is how it was known in its early days.
In this article I’m going to provide a brief introduction to OpenAPI, and give you the three main reasons why I think it can be a great addition to your API project.
What does OpenAPI look like?
To use OpenAPI in your project, you have to create a specification document that describes your API or web service. OpenAPI specifications can be written in JSON or YAML formats. The OpenAPI Specification page describes in detail what the contents of this document should be, but if you want to have a rough idea of the format, here is a fragment of a document:
openapi: 3.0.3 info: title: My Example API version: 2.3 servers: - url: https://awesome.app.io/api/v2 …