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

Sending and receiving group chats


Being able to hold a conversation with a group is cool and fun and can be useful for events. This recipe will let you store all conversations for a group in the database and send replies to each member.

Getting ready

The complete source code for this recipe can be found in the Chapter6/Recipe6/ folder.

How to do it...

We're going to build a simple app that will send and receive messages to and from a group of people. This app will forward any message received at the designated phone number of the people on the group list and send any messages you choose as well.

  1. Download the Twilio Helper Library from https://github.com/twilio/twilio-php/zipball/master and unzip it.

  2. Upload the Services/ folder to your website.

  3. Upload config.php to your website and make sure the following variables are set as follows:

    <?php
    session_start();
    $accountsid = '';   //  YOUR TWILIO ACCOUNT SID
    $authtoken = '';    //  YOUR TWILIO AUTH TOKEN
    $fromNumber = '';   //  PHONE NUMBER CALLS...