Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Gipetto/twilio-php into …
Browse files Browse the repository at this point in the history
…sean_changes
  • Loading branch information
Kevin Burke committed Oct 21, 2011
2 parents ef92db4 + 8965e75 commit 2d0cb26
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 59 deletions.
4 changes: 3 additions & 1 deletion Services/Twilio/Rest/Account.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ protected function init()
'outgoing_callerids',
'recordings',
'sms_messages',
'transcriptions'
'transcriptions',
'connect_apps',
'authorized_connect_apps'
);

$this->sandbox = new Services_Twilio_Rest_Sandbox(
Expand Down
6 changes: 6 additions & 0 deletions Services/Twilio/Rest/AuthorizedConnectApp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

class Services_Twilio_Rest_AuthorizedConnectApp
extends Services_Twilio_InstanceResource
{
}
10 changes: 10 additions & 0 deletions Services/Twilio/Rest/AuthorizedConnectApps.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

class Services_Twilio_Rest_AuthorizedConnectApps
extends Services_Twilio_ListResource
{
public function create($name, array $params = array())
{
throw new BadMethodCallException('Not allowed');
}
}
4 changes: 4 additions & 0 deletions Services/Twilio/Rest/Call.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public function hangup()
$this->update('Status', 'completed');
}

public function route($url) {
$this->update('Url', $url);
}

protected function init()
{
$this->setupSubresources(
Expand Down
6 changes: 6 additions & 0 deletions Services/Twilio/Rest/ConnectApp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

class Services_Twilio_Rest_ConnectApp
extends Services_Twilio_InstanceResource
{
}
10 changes: 10 additions & 0 deletions Services/Twilio/Rest/ConnectApps.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

class Services_Twilio_Rest_ConnectApps
extends Services_Twilio_ListResource
{
public function create($name, array $params = array())
{
throw new BadMethodCallException('Not allowed');
}
}
2 changes: 1 addition & 1 deletion Services/Twilio/Twiml.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Excepttion class for Services_Twilio_Twiml.
* Exception class for Services_Twilio_Twiml.
*/
class Services_Twilio_TwimlException extends Exception {}

Expand Down
2 changes: 1 addition & 1 deletion docs/api/rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ PhoneNumber

.. php:class:: Services_Twilio_Rest_IncomingPhoneNumber
For more information, see the `IncomingPhoneNumber Instance Resource <http://www.twilio.com/docs/api/rest/incoming-phone-number#instance>`_ documentation.
For more information, see the `IncomingPhoneNumber Instance Resource <http://www.twilio.com/docs/api/rest/incoming-phone-numbers#instance>`_ documentation.

.. php:attr:: sid
Expand Down
56 changes: 28 additions & 28 deletions docs/usage/rest/applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ Creating Applications
==============================

.. code-block:: php
$client = new Services_Twilio('AC123', '123');
$application = $client->account->applications->create('Application Friendly Name',
array(
'FriendlyName' => 'My Application Name',
'VoiceUrl' => 'http://foo.com/voice/url',
'VoiceFallbackUrl' => 'http://foo.com/voice/fallback/url',
'VoiceMethod' => 'POST',
'SmsUrl' => 'http://foo.com/sms/url',
'SmsFallbackUrl' => 'http://foo.com/sms/fallback/url',
'SmsMethod' => 'POST'
)
);
$client = new Services_Twilio('AC123', '123');
$application = $client->account->applications->create('Application Friendly Name',
array(
'FriendlyName' => 'My Application Name',
'VoiceUrl' => 'http://foo.com/voice/url',
'VoiceFallbackUrl' => 'http://foo.com/voice/fallback/url',
'VoiceMethod' => 'POST',
'SmsUrl' => 'http://foo.com/sms/url',
'SmsFallbackUrl' => 'http://foo.com/sms/fallback/url',
'SmsMethod' => 'POST'
)
);
Updating An Application
==============================

.. code-block:: php
$client = new Services_Twilio('AC123', '123');
$application = $client->account->applications->get('AP123');
$application->update(array(
'VoiceUrl' => 'http://foo.com/new/voice/url'
));
$client = new Services_Twilio('AC123', '123');
$application = $client->account->applications->get('AP123');
$application->update(array(
'VoiceUrl' => 'http://foo.com/new/voice/url'
));
Finding an Application by Name
Expand All @@ -40,11 +40,11 @@ Find an :class:`Application` by its name (full name match).

.. code-block:: php
$client = new Services_Twilio('AC123', '123');
$application = false;
$params = array(
'FriendlyName' => 'My Application Name'
);
foreach($client->account->applications->getIterator(0, 1, $params) as $_application) {
$application = $_application;
}
$client = new Services_Twilio('AC123', '123');
$application = false;
$params = array(
'FriendlyName' => 'My Application Name'
);
foreach($client->account->applications->getIterator(0, 1, $params) as $_application) {
$application = $_application;
}

0 comments on commit 2d0cb26

Please sign in to comment.