Book Image

Twilio Cookbook: Second Edition

By : Roger Stringer
Book Image

Twilio Cookbook: Second Edition

By: Roger Stringer

Overview of this book

Table of Contents (20 chapters)
Twilio Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Tracking orders


Yes, this is another order status tracking recipe. But this one will demonstrate how to use it inside OpenVBX.

This order tracker will let us create a page where you can enter in orders and their statuses and also incorporate the tracking into call flows.

For example, if we were setting up an IVR-type system, pressing 2 might load the order tracking code and prompt the user to enter in their order ID.

Getting ready

The complete source code for this recipe can be found at Chapter10/Recipe4 in the source code for this book.

How to do it…

Let's build an order tracking system into our OpenVBX plugin now. We're going to set up an interface to store order IDs and statuses; then we'll perform a look-up of those orders when people call in. Perform the following steps to do so:

  1. Create a folder in your plugins folder and name it orders.

  2. Create a file and name it plugin.json, containing the following code:

    {
      "name" : "Orders",
      "description" : "Allows order tracking over the phone",
      "links...