Build the future of communications.
Start Building for Free

Twilio Functions posts

  • By Dhruv Patel
    How to Call an AI Friend using GPT-3 with Twilio Voice and Functions How to call an AI friend Header

    I always used to find myself getting into unwanted social situations that I could never get out of. As the engineer I am, I decided it’d be fun to build and publish a quick solution to this using my toolbelt here at Twilio: How to Escape Pesky Situations using Twilio Functions and TwiML Bins. This solution allowed me to text my “friend” Joanna – an Amazon Polly voice – a key phrase which would trigger Joanna to call me and respond as if there was an emergency using a human-like synthesized speech.

    This solution then made me wonder what other fun ways Joanna could help me out. Since it’s also National Anti-Boredom Month (July), I started focusing on ways to tackle boredom and pass time.

    Gif of bored kid on couch

    Whether it’s walking home from the subway or waiting in line at the store I always find myself needing to kill time. I could …

    Read More
  • By Lizzie Siegle
    SMS Notifications On Pageviews with Segment and JavaScript Copy of D03 Blog Image Round (2).png

    Twilio acquired Segment last year to help developers unify customer data across every customer touchpoint. I held off on using Segment for a while because I thought Segment was only for businesses, but I learned recently that I, an indie developer, have a use case for it. Read on to learn how to use Segment and Twilio Serverless to send SMS notifications when someone visits your website.

    Do you prefer learning via video more? Check out this TikTok summarizing this tutorial in two minutes!


    To follow along with this post, you need three things:

    Add a Segment Source

    First off, we need to add …

    Read More
  • By Phil Nash
    Twilio SendGridとNode.jsを使用してメール問い合わせフォームを構築 How to build an email contact form with SendGrid and Node JP

    この記事はPhil Nashこちらで公開した記事(英語)を日本語化したものです。


    本稿では、Twilio SendGridベースの開発プロジェクトの一例として、ウェブサイト上で問い合わせフォームを構築し、メールアドレスを公開することなく問い合わせのメールを受け取れるようにする方法を説明します。

    プロジェクトはTwilio Functionsも使って構築しますが、本稿でご紹介するコードはあらゆるNode.js環境での使用に対応しています。


    ユーザーがお問合せフォームを送信した際は、お問合せフォームを入力した人のメールアドレスを送信元とするメールがウェブサイト運営者に送信されることがよくあります。しかし、メール送信に関する信頼性を維持するため、Twilio SendGridは単一送信元として検証されたアドレス、または認証済みのドメインからの送信しか許可しません。

    そのため、提供されたメールアドレスをfromアドレスとして使用する代わりに、reply-toアドレスに設定できます。この方法であれば、Twilio SendGridは認証済みメールアドレスからメールを送信する一方で、受信 …

    Read More
  • By Phil Nash
    How to build an email contact form with SendGrid and Node.js How to build an email contact form with SendGrid and Node.js

    Displaying your email address on a website can result in your email being scraped and used for spam. One way to get around this, but still allow people to contact you from your website, is to build a contact form.

    In this post you will build a contact form using SendGrid to deliver emails to your inbox without exposing your email address.

    You will build the project with Twilio Functions, but you could adapt the code to use in any Node.js environment.

    How is this different to sending an email with an API?

    When someone fills in a contact form, you might expect to receive an email in your inbox from their email address. However, to maintain a good email sending reputation, SendGrid only allows you to send emails from addresses that you have verified individually or from domains you have authenticated.

    So, instead of using the submitted …

    Read More
  • By Stephenie Minami Nakajima
    Twilio Functionsを使ったサーバーレス開発のはじめ方 Twilio Functionsを使ったサーバーレス開発のはじめ方



    「サーバーレス(Serverless)」というキーワードは近年脚光を浴び、さまざまな分野でサーバーレスを用いたソリューションが構築されています。本稿では、サーバーレス開発の概念と、Twilioが提供するサーバーレス環境である、Twilio Functionsを使った開発方法をご紹介します。






    Twilio Functionsとは?

    Twilio Functionsは、Twilioが提供するサーバーレス環境です。Twilioアカウ …

    Read More
  • By Treasure Porth
    Send an SMS with Vue and Twilio Functions smsvue.png

    In this article you’ll learn how to send an SMS using Vue 3 on the front end and Twilio Functions on the backend. Because Vue is a front end framework, you’ll use Twilio functions to handle sending a message and to avoid exposing your Twilio credentials.

    To demonstrate these concepts, you’ll build a Vue app with a button. When the button is clicked, a POST request will be made to your API. The API will send a message and then return a response back to your Vue application.


    In order to follow along with this tutorial, you’ll need these tools and technologies:

    Create your API with Twilio Functions

    Create a new Function Service

    Twilio Functions …

    Read More
  • By Dhruv Patel
    How to Escape Pesky Situations using Twilio Functions and TwiML Bins Header Image for How to Escape Pesky Situations

    Have you ever needed an out in a sticky situation? Maybe it’s a bad date, an awkward run-in, or you simply just want to leave, we’ve all been there. Here’s a nifty solution you can build yourself! Whenever needed, you can use your Twilio number to bail you out with a faux phone call in a few steps.

    Awkward Man GIF

    In this tutorial, you will learn how to leverage Twilio Functions with TwiML Bins to set up a phone service that will call your personal phone number whenever you send an SMS message to your Twilio number. This phone service will utilize synthesized speech to act as your “friend”.


    Using TwiML Bins

    TwiML Bins are a serverless solution that allows you to provide Twilio-based instructions …

    Read More
  • By Phil Nash
    Upload audio files for your Studio IVR with the Twilio CLI Assets Plugin Upload audio files for your Twilio IVR with the Twilio CLI Assets Plugin

    When building an Interactive Voice Response, or IVR, system with Twilio you might start off using text-to-speech to read out your prompts. As you move to production you may want to replace the text-to-speech with real recordings.

    In this post you will learn how to use the Twilio CLI Assets Plugin to store your recordings in a Twilio Assets service and use them in a Twilio Studio IVR application.

    Let's build an IVR

    To see this in action, let's put together a quick IVR system in Twilio Studio. To do this you will need a Twilio account. If you don't have one yet, sign up for a free Twilio account here and receive $10 credit when you upgrade.

    Open the Studio dashboard in the Twilio console and create a new Flow. Give your new Flow a name and click Next.

    When you create a new Flow a popup appears to ask for a name for the Flow. Call it "IVR".

    Select the IVR/Phone Tree template …

    Read More
  • By Niels Swimberghe
    Proxy your phone number with Twilio Programmable Voice and Twilio Functions Header

    Using Twilio's Super Network, you can quickly buy phone numbers from around the world. You can even specify a specific area code to buy a phone number that is local to a certain state, territory, or region.

    With Twilio Voice, you can quickly integrate voice communication into your applications. For the application in this tutorial, you'll use Twilio phone numbers, Twilio Voice, and Twilio Functions to create a proxy phone number!

    What do I mean by a proxy phone number? Before explaining that, I will discuss a similar concept. In web development, there's a concept of "reverse proxies". When you send HTTP requests to a reverse proxy, the reverse proxy forwards the traffic to a web server on a private network. This way the web server still serves a website but isn't exposed directly to the internet adding benefits like security, performance enhancements, and much more.

    Similarly, …

    Read More
  • By Phil Nash
    Twilio CLIのAssetsプラグインをリリースしました Assetsプラグインを発表 - Twilio CLIを使ってアセットをアップロード・管理

    この記事はTwilio Developer AdvocateのPhil Nashこちらで公開した記事(英語)を日本語化したものです。

    Twilio CLIは、Twilioの開発者にとって便利なツールです。 コマンドラインから手軽にTwilioのすべてのAPIにアクセスできるだけでなく、電話番号管理や、ローカル環境でWebhook URLにワンステップでアクセスできるコマンド、プラグインシステムなど数多くの機能を提供します。CLIプラグインはCLIのコア機能を拡張し、Flexプラグインの構築と管理アクセストークンの生成Twilio Functionsを使った構築、そして今回のAssetsプラグインによるTwilio Assetsサービスへのアセットのアップロードなどを可能にしてくれます。



    Assetsプラグインでは、画像や音声ファイルなどのアセットの保管先として使用できるAssetsサービスを作成し、アセットのアップロードや管理が行えます。作成したAssetsサービスはTwilioのアプリケーションで使用できます。たとえば、音声ファイルをアップロードして、Twilio Voiceを利用した音声通話中に<Play>動詞で再生するファイルとして使用したり、MMSでユーザーに送信する画像WhatsAppメディアメッセージをアップロードしたりすることができます。


    Asse …

    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.