Twilio Queue Sid

时间:2015-06-15 22:35:14

标签: twilio twiml

我正在使用以下来自twilio网站的代码。我需要将队列的QueueSid命名为" Sales"。我该怎么做呢?如果有关于这个主题的文档,请指出我。提前谢谢!

'ART#'

1 个答案:

答案 0 :(得分: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;