Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'recording-documentation'

  • Loading branch information...
commit f6d76f777310f1fa63e48f6f1a7fdd4e1d3e88f0 2 parents f831b5a + 27dbe58
Kevin Burke authored
View
2  docs/usage/rest/calls.rst
@@ -18,7 +18,7 @@ The :class:`Calls` resource allows you to make outgoing calls:
print $call->length;
print $call->sid;
-Accessing Resources from a specific Call
+Accessing Resources from a Specific Call
========================================
The :class:`Call` resource has some sub resources you can access, such as
View
28 docs/usage/rest/phonenumbers.rst
@@ -13,8 +13,8 @@ First, we need to search for an available phone number. Use the
.. code-block:: php
- $accountSid = 'AC58f1e8f2b1c6b88012a4be0c279';
- $authToken = 'b7c3f506c974791449ba57e5c2';
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
$client = new Services_Twilio($accountSid, $authToken);
$numbers = $client->account->available_phone_numbers->getList('US', 'TollFree');
@@ -27,8 +27,8 @@ code, or which contain a certain pattern.
.. code-block:: php
- $accountSid = 'AC58f1e8f2b1c6b88012a4be0c279';
- $authToken = 'b7c3f506c974791449ba57e5c2';
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
$client = new Services_Twilio($accountSid, $authToken);
@@ -48,8 +48,8 @@ Once you have a phone number, purchase it by creating a new
.. code-block:: php
- $accountSid = 'AC58f1e8f2b1c6b88012a4be0c279';
- $authToken = 'b7c3f506c974791449ba57e5c2';
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
$client = new Services_Twilio($accountSid, $authToken);
@@ -62,8 +62,8 @@ Tying the two together, you can search for a number, and then purchase it.
.. code-block:: php
- $accountSid = 'AC58f1e8f2b1c6b88012a4be0c279';
- $authToken = 'b7c3f506c974791449ba57e5c2';
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
$client = new Services_Twilio($accountSid, $authToken);
@@ -80,8 +80,8 @@ You can also purchase a random number with a given area code (US/Canada only):
.. code-block:: php
- $accountSid = 'AC58f1e8f2b1c6b88012a4be0c279';
- $authToken = 'b7c3f506c974791449ba57e5c2';
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
$client = new Services_Twilio($accountSid, $authToken);
$purchasedNumber = $client->account->incoming_phone_numbers->create(array('AreaCode' => '925'));
@@ -98,8 +98,8 @@ in the `Incoming Phone Number REST API Documentation.
.. code-block:: php
- $accountSid = 'AC58f1e8f2b1c6b88012a4be0c279';
- $authToken = 'b7c3f506c974791449ba57e5c2';
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
$client = new Services_Twilio($accountSid, $authToken);
$numbers = $client->account->incoming_phone_numbers;
@@ -115,8 +115,8 @@ delete, from the incoming phone numbers object.
.. code-block:: php
- $accountSid = 'AC58f1e8f2b1c6b88012a4be0c279';
- $authToken = 'b7c3f506c974791449ba57e5c2';
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
$client = new Services_Twilio($accountSid, $authToken);
$number = $client->account->incoming_phone_numbers;
View
61 docs/usage/rest/recordings.rst
@@ -0,0 +1,61 @@
+==========
+Recordings
+==========
+
+Listing Recordings
+------------------
+
+Run the following to get a list of all of your recordings:
+
+.. code-block:: php
+
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
+ $client = new Services_Twilio($accountSid, $authToken);
+
+ foreach($client->account->recordings as $recording) {
+ echo "Access recording {$recording->sid} at:" . "\n";
+ echo $recording->uri;
+ }
+
+For more information about which properties are available for a recording
+object, please see the `Twilio Recordings API Documentation <http://www.twilio.com/docs/api/rest/recording>`_.
+
+Please note that the ``uri`` returned by default is a JSON dictionary
+containing metadata about the recording; you can access the .wav version by
+stripping the ``.json`` extension from the ``uri`` returned by the library.
+
+Filtering Recordings By Call Sid
+--------------------------------
+
+Pass filters as an array to filter your list of recordings, with any of the
+filters listed in the `recording list documentation <http://www.twilio.com/docs/api/rest/recording#list-get-filters>`_.
+
+.. code-block:: php
+
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
+ $client = new Services_Twilio($accountSid, $authToken);
+
+ foreach($client->account->recordings->getIterator(0, 50, array('DateCreated>=' => '2011-01-01')) as $recording) {
+ echo $recording->uri . "\n";
+ }
+
+Deleting a Recording
+--------------------
+
+To delete a recording, get the sid of the recording, and then pass it to the
+client.
+
+.. code-block:: php
+
+ $accountSid = 'AC1234567890abcdef1234567890a';
+ $authToken = 'abcdef1234567890abcdefabcde9';
+ $client = new Services_Twilio($accountSid, $authToken);
+
+ foreach($client->account->recordings as $recording) {
+ $client->account->recordings->delete($recording->sid);
+ echo "Deleted recording {$recording->sid}, the first one in the list.";
+ break;
+ }
+
Please sign in to comment.
Something went wrong with that request. Please try again.