0

我正在使用从 twilio 网站获得的以下代码。我需要获取名为“Sales”的队列的 QueueSid。我该怎么做呢?如果有关于这个主题的文档,也请指出我那里。提前致谢!

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

1 回答 1

1

Twilio 开发人员布道者在这里。

您可以使用队列列表资源搜索所有队列。然后,您将需要按友好名称过滤以获取您的队列。尝试这样的事情:

<?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;
于 2015-06-16T08:04:55.023 回答