You are previewing Twilio Cookbook Second Edition.
O'Reilly logo
Twilio Cookbook Second Edition

Book Description

Over 70 easy-to-follow recipes, from exploring the key features of Twilio to building advanced telephony apps

In Detail

Have you ever wanted to integrate phone features into a project you were working on? Maybe you wanted to send SMS messages to your customers about the latest sales? Maybe you want to set up a company directory with voice mail? Or maybe you want to add two-factor authentication to your web sites to verify your users? Since Twilio was launched in 2007, developers have had an easy and efficient way to do these tasks. The power of Twilio’s API is huge and lets you add any type of phone solution to your website from two-factor authentication to verify your users, to setting up a company directory and a voice mail system. The possibilities are endless.

This book is a must have for Twilio development, providing you with a number of clear step-by-step exercises. It helps you take advantage of the real power of the Twilio API, and gives you a good foundation in using it in your websites.

This book examines the Twilio API, and breaks down the mystery and confusion that surrounds adding telephone functionality to your websites. As you go through the recipes, you will learn how to take advantage of the Twilio API quickly and painlessly.

You will learn how to build your own IVR system, company directory, and voicemail box, and also how to set up a two-factor authentication system to verify users, track orders via SMS, send surveys using SMS, allow users to buy phone numbers, set up and delete sub-accounts, and check to see if a human is answering a phone call. We will also combine Twilio with other APIs to build a handy local search system such as a local business search, movie listings search, and web search. We’ll also dive into call queues and how to handle multiple incoming callers to agents. If you want to discover the endless benefits of Twilio, then this book is for you.

What You Will Learn

  • Add two-factor authentication to your web apps to verify your users
  • Explore how to generate usage records and set up voice mails and emergency calling systems
  • Conduct surveys using SMS and make your account more client friendly
  • Build a fully functional conference calling system
  • Use APIs to build a local search system to find businesses, movies, and weather forecasts
  • Delve into SMS messaging and learn how to set up order tracking, bulk SMS sending, and a group chat system
  • Set up an appointment reminder using SMS
  • Build an Interactive Voice Response menu system
  • Construct your first PBX system
  • Understand OpenVBX plugins to extend its existing functionality
  • Utilize Twilio's new picture messaging, and build a collaborative Picture Message Gallery
  • Use Twilio client to make calls from your browser
  • Discover how to handle multiple incoming callers
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Twilio Cookbook Second Edition
      1. Table of Contents
      2. Twilio Cookbook Second Edition
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Into the Frying Pan
        1. Introduction
        2. Adding two-factor voice authentication to verify users
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Using Twilio SMS to set up two-factor authentication for secure websites
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Adding order verification
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Adding the Click-to-Call functionality to your website
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Recording a phone call
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Setting up a company directory
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Setting up Text-to-Speech
          1. Getting ready
          2. How to do it...
          3. How it works...
      9. 2. Now We're Cooking
        1. Introduction
        2. Tracking account usage
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Screening calls
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Buying a phone number
          1. Getting ready
          2. How to do it...
          3. How it works…
        5. Setting up a voicemail system
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Building an emergency calling system
          1. Getting ready
          2. How to do it...
          3. How it works...
      10. 3. Conducting Surveys via SMS
        1. Introduction
        2. Why use PDO instead of the standard MySQL functions?
        3. Letting users subscribe to receive surveys
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Building a survey tree
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Sending a survey to your users
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Adding tracking for each user
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Listening to user responses and commands
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Building a chart of responses
          1. Getting ready
          2. How to do it...
          3. How it works...
      11. 4. Building a Conference Calling System
        1. Introduction
        2. Scheduling a conference call
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Sending an SMS to all participants at the time of the call
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Starting and recording a conference
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Joining a conference call from the web browser
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Monitoring the conference call
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Muting a participant
          1. Getting ready
          2. How to do it...
          3. How it works...
      12. 5. Combining Twilio with Other APIs
        1. Introduction
        2. Searching for local businesses via text
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Getting the local weather forecast
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Searching for local movie listings
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Searching for classifieds
          1. Getting ready...
          2. How to do it...
          3. How it works...
        6. Getting local TV listings
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Searching Google using SMS
          1. Getting ready
          2. How to do it...
          3. How it works
        8. Searching the stock market
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Getting the latest headlines
          1. Getting ready
          2. How to do it...
          3. How it works...
      13. 6. Sending and Receiving SMS Messages
        1. Introduction
        2. Sending a message from a website
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Replying to a message from the phone
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Forwarding SMS messages to another phone number
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Sending bulk SMS to a list of contacts
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Tracking orders with SMS
          1. Getting Ready
          2. How to do it...
          3. How it works...
        7. Sending and receiving group chats
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Sending SMS messages in a phone call
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Monitoring a website
          1. Getting ready
          2. How to do it...
          3. How it works...
      14. 7. Building a Reminder System
        1. Introduction
        2. Scheduling reminders via text
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Getting notified when the time comes
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Retrieving a list of upcoming reminders
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Canceling an upcoming reminder
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Adding another person to a reminder
          1. Getting ready
          2. How to do it…
          3. How it works…
      15. 8. Building an IVR System
        1. Introduction
        2. Setting up IVRs
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Screening and recording calls
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Logging and reporting calls
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Looking up HighriseHQ contacts on incoming calls
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Getting directions
          1. Getting Ready
          2. How to do it...
          3. How it works…
        7. Leaving a message
          1. Getting Ready
          2. How to do it...
          3. How it works…
        8. Sending an SMS to your Salesforce.com contacts
          1. Getting Ready
          2. How to do it...
          3. How it works...
      16. 9. Building Your Own PBX
        1. Introduction
        2. Getting started with PBX
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Setting up a subaccount for each user
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Letting a user purchase a custom phone number
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Allowing users to make calls from their call logs
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Allowing incoming phone calls
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Allowing outgoing phone calls
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Deleting a subaccount
          1. Getting ready
          2. How to do it...
          3. How it works...
      17. 10. Digging into OpenVBX
        1. Introduction
        2. Building a call log plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Building a searchable company directory
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Collecting Stripe payments
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Tracking orders
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Building a caller ID routing plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Testing call flows
          1. Getting ready
          2. How to do it…
          3. How it works…
      18. 11. Sending and Receiving Picture Messages
        1. Introduction
        2. Receiving MMS messages
          1. Getting ready
          2. How to do it…
        3. Sending picture messages from a website
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Making the picture message gallery
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Filtering picture messages
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Blacklisting and whitelisting the submissions
          1. Getting ready
          2. How to do it…
          3. How it works…
      19. 12. Call Queuing
        1. Introduction
        2. Adding incoming callers to a call queue
          1. Getting started
          2. How to do it…
          3. How it works…
        3. Obtaining the average wait time for call queues
          1. Getting started
          2. How to do it…
          3. How it works…
        4. Setting a maximum queue size
          1. Getting started
          2. How to do it…
          3. How it works…
        5. Connecting the first caller in the queue
          1. Getting started
          2. How to do it…
          3. How it works…
      20. 13. Working with Twilio Client
        1. Introduction
        2. Setting up the client
          1. How to do it…
          2. How it works…
        3. Receiving incoming calls in the browser
          1. Getting Started
          2. How to do it…
          3. How it works…
        4. Making outgoing calls from the browser
          1. Getting Started
          2. How to do it…
          3. How it works…
        5. Making browser-to-browser calls
          1. Getting Started
          2. How to do it…
          3. How it works…
        6. Displaying availability
          1. Getting Started
          2. How to do it…
          3. How it works…
      21. Index