Book Image

Twilio Best Practices

Book Image

Twilio Best Practices

Overview of this book

Table of Contents (15 chapters)
Twilio Best Practices
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding Twilio Client to your web applications


Let's start adding Twilio Client functionality to a real application with an in-depth tutorial, including complete HTML, JavaScript, and PHP code samples.

If you're not using PHP but rather another server-side language, the principles will be extremely similar. Simply see the Twilio Capabilities documentation for your own language. The JavaScript will remain the same irrespective of what you're running on your backend.

Suppose we add a page to our website that allows users to call our customer support team from within their browser. We'll let them choose the kind of problem they're having, and then we'll use that information to connect them to the right person.

Setting up a TwiML application

To place outgoing calls from a Twilio Client application, we need to set up a TwiML Application. This can be done via the API, as we saw in the previous chapter, but as this is most likely going to be a one-off task, we'll just do it from our Dashboard.

To get...