| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| Rest | 2011-12-08 | ||
| RequestValidator.php | 2011-12-08 | 934 Bytes | |
| TinyHttp.php | 2011-12-08 | 3.5 kB | |
| InstanceResource.php | 2011-12-08 | 1.3 kB | |
| Page.php | 2011-12-08 | 1.4 kB | |
| PartialApplicationHelper.php | 2011-12-08 | 1.1 kB | |
| ArrayDataProxy.php | 2011-12-08 | 1.8 kB | |
| Twiml.php | 2011-12-08 | 2.9 kB | |
| Capability.php | 2011-12-08 | 10.4 kB | |
| DataProxy.php | 2011-12-08 | 1.0 kB | |
| RestException.php | 2011-12-08 | 454 Bytes | |
| CachingDataProxy.php | 2011-12-08 | 3.9 kB | |
| ListResource.php | 2011-12-08 | 4.5 kB | |
| AutoPagingIterator.php | 2011-12-08 | 1.8 kB | |
| Resource.php | 2011-12-08 | 2.2 kB | |
| Totals: 15 Items | 37.2 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>