Twilio Queue Sid

463 views Asked by At

I am using the following code that I got from the twilio website. I need to get the QueueSid of my queue named "Sales". How do I go about doing this? If there is documentation for this subject please point me there as well. Thanks in advance!

<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$accountSid = "ACYYYYYYYYYY"; 
$authToken = "XXXXXXXXX"; 
$client = new Services_Twilio($accountSid,$authToken);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$member = $client->account->queues->get('QU5ef8732a3c49700934481addd5ce1659')->members->get("Front");
$member->update(array(
    "Url" => "https://dl.dropboxusercontent.com/u/11489766/learn/voice.xml",
    "Method" => "POST"
));
echo $member->wait_time;
1

There are 1 answers

0
philnash On

Twilio developer evangelist here.

You can search for all of your queues using the Queues list resource. Then you will want to filter by the Friendly name to get your queue. Try something like this:

<?php
  // Get the PHP helper library from twilio.com/docs/php/install
  require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

  // Your Account Sid and Auth Token from twilio.com/user/account
  $accountSid = "ACYYYYYYYYYY"; 
  $authToken = "XXXXXXXXX"; 

  $client = new Services_Twilio($accountSid, $authToken);

  foreach($client->account->queues as $queue){
      if ($queue->friendly_name == "Sales"){
          $foundQueue = $queue;
          break;
      }
  }
  echo $foundQueue;