[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/twilio-php/docs/usage/rest/ -> recordings.rst (source)

   1  ==========
   2  Recordings
   3  ==========
   4  
   5  Listing Recordings
   6  ------------------
   7  
   8  Run the following to get a list of all of your recordings:
   9  
  10  .. code-block:: php
  11  
  12      $accountSid = 'AC1234567890abcdef1234567890a';
  13      $authToken = 'abcdef1234567890abcdefabcde9';
  14      $client = new Services_Twilio($accountSid, $authToken);
  15  
  16      foreach($client->account->recordings as $recording) {
  17          echo "Access recording {$recording->sid} at:" . "\n";
  18          echo $recording->uri;
  19      }
  20  
  21  For more information about which properties are available for a recording
  22  object, please see the `Twilio Recordings API Documentation <http://www.twilio.com/docs/api/rest/recording>`_.
  23  
  24  Please note that the ``uri`` returned by default is a JSON dictionary
  25  containing metadata about the recording; you can access the .wav version by
  26  stripping the ``.json`` extension from the ``uri`` returned by the library.
  27  
  28  Filtering Recordings By Call Sid
  29  --------------------------------
  30  
  31  Pass filters as an array to filter your list of recordings, with any of the
  32  filters listed in the `recording list documentation <http://www.twilio.com/docs/api/rest/recording#list-get-filters>`_.
  33  
  34  .. code-block:: php
  35  
  36      $accountSid = 'AC1234567890abcdef1234567890a';
  37      $authToken = 'abcdef1234567890abcdefabcde9';
  38      $client = new Services_Twilio($accountSid, $authToken);
  39  
  40      foreach($client->account->recordings->getIterator(0, 50, array('DateCreated>' => '2011-01-01')) as $recording) {
  41          echo $recording->uri . "\n";
  42      }
  43  
  44  Deleting a Recording
  45  --------------------
  46  
  47  To delete a recording, get the sid of the recording, and then pass it to the
  48  client.
  49  
  50  .. code-block:: php
  51  
  52      $accountSid = 'AC1234567890abcdef1234567890a';
  53      $authToken = 'abcdef1234567890abcdefabcde9';
  54      $client = new Services_Twilio($accountSid, $authToken);
  55  
  56      foreach($client->account->recordings as $recording) {
  57          $client->account->recordings->delete($recording->sid);
  58          echo "Deleted recording {$recording->sid}, the first one in the list.";
  59          break;
  60      }
  61  


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1