2015-06-15 78 views
0

我正在使用從twilio網站獲得的以下代碼。我需要獲得名爲「Sales」的隊列的QueueSid。我如何去做這件事?如果有關於此主題的文檔,請在那裏指向我。提前致謝!Twilio隊列Sid

<?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

Twilio開發人員傳道這裏。

您可以使用Queues list resource搜索所有隊列。然後,您將需要按友好名稱進行過濾以獲得您的隊列。試試這樣的:

<?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; 
相關問題