我正在使用从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;发布于 2015-06-16 16:04:55
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;https://stackoverflow.com/questions/30856100
复制相似问题