| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| Recording.php | 2011-12-08 | 93 Bytes | |
| ShortCodes.php | 2011-12-08 | 90 Bytes | |
| Participant.php | 2011-12-08 | 174 Bytes | |
| Transcriptions.php | 2011-12-08 | 94 Bytes | |
| SmsMessage.php | 2011-12-08 | 94 Bytes | |
| SmsMessages.php | 2011-12-08 | 587 Bytes | |
| Transcription.php | 2011-12-08 | 97 Bytes | |
| Sandbox.php | 2011-12-08 | 91 Bytes | |
| ShortCode.php | 2011-12-08 | 93 Bytes | |
| Participants.php | 2011-12-08 | 92 Bytes | |
| Recordings.php | 2011-12-08 | 90 Bytes | |
| OutgoingCallerId.php | 2011-12-08 | 100 Bytes | |
| OutgoingCallerIds.php | 2011-12-08 | 278 Bytes | |
| Conferences.php | 2011-12-08 | 91 Bytes | |
| Notification.php | 2011-12-08 | 96 Bytes | |
| Notifications.php | 2011-12-08 | 93 Bytes | |
| AvailablePhoneNumbers.php | 2011-12-08 | 800 Bytes | |
| Conference.php | 2011-12-08 | 208 Bytes | |
| Application.php | 2011-12-08 | 95 Bytes | |
| Applications.php | 2011-12-08 | 259 Bytes | |
| AvailablePhoneNumber.php | 2011-12-08 | 105 Bytes | |
| IncomingPhoneNumbers.php | 2011-12-08 | 198 Bytes | |
| Calls.php | 2011-12-08 | 561 Bytes | |
| IncomingPhoneNumber.php | 2011-12-08 | 103 Bytes | |
| Accounts.php | 2011-12-08 | 193 Bytes | |
| Call.php | 2011-12-08 | 317 Bytes | |
| Account.php | 2011-12-08 | 650 Bytes | |
| Totals: 27 Items | 5.7 kB | 0 | |
A Brief Introduction
With version 3.0 we've simplified interaction with the Twilio REST API. No more manually creating URLS or parsing XML/JSON. You now interact with resources directly. Follow the Quickstart Guide to get up and running right now. The User Guide shows you how to get the most out of twilio-php.
Prerequisites
- PHP >= 5.2.1
- The PHP JSON extension
Installing
Via PEAR (>= 1.9.3):
pear channel-discover twilio.github.com/pear
pear install twilio/Services_Twilio
From Source
Not using PEAR? Not a problem. Download the source which includes all dependencies.
Quickstart
Want to get up running with twilio-php in minutes? Read through the quickstart here. Highly suggested reading.
Full Documentation
http://readthedocs.org/docs/twilio-php/en/latest/
Reporting Issues
Report issues using the Github Issue Tracker or email help@twilio.com.
Sample Code
Making a Call
require "Services/Twilio.php";
$sid = "ACXXXXXX"; // Your Twilio account sid
$token = "YYYYYY"; // Your Twilio auth token
$client = new Services_Twilio($sid, $token);
$call = $client->account->calls->create(
'9991231234', // From this number
'8881231234', // Call this number
'http://foo.com/call.xml'
);
Generating TwiML
To control phone calls, your application need to output TwiML. Use Services_Twilio_Twiml to easily create such responses.
$response = new Services_Twilio_Twiml();
$response->say('Hello');
$response->play('monkey.mp3', array("loop" => 5));
print $response;
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Say>Hello</Say>
<Play loop="5">monkey.mp3</Play>
</Response>