REST API: Queue

Queue インスタンス リソースを使って、個々の通話キューのクエリや管理を行います。 発信者が <Enqueue> 動詞で名前のついたキューに入れられると、この名前の Queue インスタンス リソースが存在しなければ作成されます。 キューは API を使って事前に作成することもできます。キューの中の個々の通話は、Member インスタンス リソースで表現されます。 詳細は、 メンバーのドキュメント を参照してください。

Queue リスト リソースを使って、アカウント内のキューのリストを取得できます。

Queue インスタンス リソース

このリソースは、個々のキューのインスタンスを表現します。 それぞれのキューには、アカウント内でユニークなフレンドリー ネームをつける必要があります。

リソース URI

/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}

リソースのプロパティ

Queue リソースには、次のプロパティがあります。

プロパティ 説明
Sid このキューを一意に識別する 34 文字の文字列です。
FriendlyName このキューを識別するユーザー定義の文字列です。
CurrentSize 現在このキューに存在する通話の数です。
MaxSize このキューに存在できる通話の数の上限です。 デフォルトは 100 です。 最大値は 1000 です。
AverageWaitTime AverageWaitTime | このキューのメンバーの平均待ち時間 (秒) です。 この値はリクエスト時に算出されます。

HTTP GET

{QueueSid} で識別されるキューの表現を返します。

キューの取得
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var queue = QueueResource.Fetch("QU5ef8732a3c49700934481addd5ce1659");

        Console.WriteLine(queue.AverageWaitTime);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->fetch();

echo $queue->averageWaitTime;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

queue = client.queues.get("QU5ef8732a3c49700934481addd5ce1659")
print(queue.average_wait_time)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@queue = @client.account.queues('QU5ef8732a3c49700934481addd5ce1659').fetch

puts @queue.average_wait_time
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Queue;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = client.getAccount().getQueue("QU5ef8732a3c49700934481addd5ce1659");
    System.out.println(queue.getAverageWaitTime());
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

queue = client.queues("QU5ef8732a3c49700934481addd5ce1659") \
              .fetch()

print(queue.average_wait_time)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues('QU5ef8732a3c49700934481addd5ce1659')
  .fetch((queue) => console.log(queue));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var queue = twilio.GetQueue("QU5ef8732a3c49700934481addd5ce1659");
    
    Console.WriteLine(queue.AverageWaitTime);
  }
}
<?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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client->account->queues->get("QU5ef8732a3c49700934481addd5ce1659");
echo $queue->average_wait_time;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@queue = @client.account.queues.get("QU5ef8732a3c49700934481addd5ce1659")
puts @queue.average_wait_time
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = Queue.fetcher("QU5ef8732a3c49700934481addd5ce1659").fetch();

    System.out.println(queue.getAverageWaitTime());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues("QU5ef8732a3c49700934481addd5ce1659").get(function(err, queue) {
    console.log(queue.averageWaitTime);
});
出力を表示
  • JSON
  • XML
{
    "sid": "QUxxxxxxxxx",
    "friendly_name": "persistent_queue1",
    "current_size": 0,
    "average_wait_time": 0,
    "max_size": 10,
    "date_created": "Mon, 26 Mar 2012 22:00:14 +0000",
    "date_updated": "Mon, 26 Mar 2012 22:00:14 +0000",
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx.json"
}
<TwilioResponse>
    <Queue>
        <Sid>QUxxxxxxxxx</Sid>
        <FriendlyName>persistent_queue1</FriendlyName>
        <CurrentSize>0</CurrentSize>
        <AverageWaitTime>0</AverageWaitTime>
        <MaxSize>10</MaxSize>
        <DateCreated>Mon, 26 Mar 2012 22:00:14 +0000</DateCreated>
        <DateUpdated>Mon, 26 Mar 2012 22:00:14 +0000</DateUpdated>
        <Uri>/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx</Uri>
    </Queue>
</TwilioResponse>
キューの取得

HTTP POST

POST リクエストで、FriendlyName または MaxSize を変更します。 キューの MaxSize を現在より小さいサイズに変更すると、このキューのサイズが新しい MaxSize を下回るまでは、着信リクエストを拒否します。

キューの更新
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        QueueResource.Update("QU32a3c49700934481addd5ce1659f04d2", maxSize: 123);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->update(
        array("maxSize" => "123")
    );

echo $queue->averageWaitTime;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

queue = client.queues.update("QU32a3c49700934481addd5ce1659f04d2", max_size="123")
print(queue.average_wait_time)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@queue = @client.account.queues('QU32a3c49700934481addd5ce1659f04d2').fetch

@queue.update(max_size: '123')

puts @queue.average_wait_time
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU32a3c49700934481addd5ce1659f04d2.json \
    -d "MaxSize=123" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU32a3c49700934481addd5ce1659f04d2 \
    -d "MaxSize=123" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Queue;
import com.twilio.sdk.resource.list.QueueList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = client.getAccount().getQueue("QU32a3c49700934481addd5ce1659f04d2");
    // Build a filter for the QueueList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("MaxSize", "123"));
    queue.update(params); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

queue = client.queues("QU32a3c49700934481addd5ce1659f04d2") \
              .update(max_size="123")

print(queue.average_wait_time)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues('QU32a3c49700934481addd5ce1659f04d2')
  .update({maxSize: '123'})
  .then((queue) => console.log(queue.averageWaitTime));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken); 
    
    twilio.UpdateQueue("QU32a3c49700934481addd5ce1659f04d2", null, 123);
  }
}
<?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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client->account->queues->get("QU32a3c49700934481addd5ce1659f04d2");
$queue->update(array(
        "MaxSize" => "123"
    ));
echo $queue->average_wait_time;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@queue = @client.account.queues.get("QU32a3c49700934481addd5ce1659f04d2")
@queue.update(:max_size => "123")
puts @queue.average_wait_time
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = Queue.updater("QU32a3c49700934481addd5ce1659f04d2").setMaxSize(123).update();

    System.out.println(queue.getAverageWaitTime());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues("QU32a3c49700934481addd5ce1659f04d2").update({
    maxSize: "123"
}, function(err, queue) {
    console.log(queue.averageWaitTime);
});
出力を表示
  • JSON
  • XML
{ 
    "average_wait_time": 0,
    "current_size": 0,
    "date_created": "Thu, 21 Jun 2012 23:55:36 +0000",
    "date_updated": "Fri, 22 Jun 2012 00:02:15 +0000",
    "friendly_name": "newqueue",
    "max_size": 123,
    "sid": "QUxxxxxxxxxxxx",
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxxxxx.json"
}
<TwilioResponse>
    <Queue>
        <Sid>QUxxxxxxxxxxxx</Sid>
        <FriendlyName>newqueue</FriendlyName>
        <CurrentSize>0</CurrentSize>
        <AvgWaitTime>0</AvgWaitTime>
        <MaxSize>123</MaxSize>
        <DateCreated>2012-06-21 23:55:36</DateCreated>
        <DateUpdated>2012-06-22 00:02:15</DateUpdated>
        <Uri>/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxxxxx</Uri>
    </Queue>
</TwilioResponse>
キューの更新

HTTP PUT

サポートしません。

HTTP DELETE

DELETE メソッドでキューを削除します。 削除できるのは空のキューのみです。 キューを削除しても、同じフレンドリー ネームのキューが動的に生成されなくなることはありません。

Queue インスタンス サブリソース

それぞれの Queue インスタンス リソースには、現在このキューに存在するメンバーのセットを表現する Member サブリソースがあります。

Members リスト サブリソース
/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members

{QueueSid} で識別されるキューに現在接続しているメンバーのセットを表現します。 プロパティとレスポンスのフォーマットについては、 Member リソースのドキュメント を参照してください。

Queues リスト リソース

リソース URI

/2010-04-01/Accounts/{AccountSid}/Queues

HTTP GET

アカウント内のキューのリストを返します。 このリストは ページ情報を含みます。ページ情報は DateUpdated パラメーターでソートされ、最も新しいキューが先頭になります。

例 1
すべてのキューのリストの取得
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var queues = QueueResource.Read();

        foreach (var queue in queues)
        {
            Console.WriteLine(queue.AverageWaitTime);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of queues and echo a property for each one
foreach ($client->queues->read() as $queue) {
    echo $queue->averageWaitTime;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of queue objects with the properties described above
queues = client.queues.list()
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over queues and print out a property for each one
@client.account.queues.list.each do |queue|
  puts queue.average_wait_time
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Queue;
import com.twilio.sdk.resource.list.QueueList;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
 
    QueueList queues = client.getAccount().getQueues();
    
    // Loop over queues and print out a property for each one.
    for (Queue queue : queues) {
      System.out.println(queue.getAverageWaitTime());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of queue objects with the properties described above
for queue in client.queues.list():
    print(queue.average_wait_time)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues
  .each((queue) => console.log(queue.averageWaitTime));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var queues = twilio.ListQueues();
    
    foreach (var queue in queues.Queues)
    {
      Console.WriteLine(queue.AverageWaitTime);
    }
  }
}
<?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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of queues and echo a property for each one
foreach ($client->account->queues as $queue) {
    echo $queue->average_wait_time;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Loop over queues and print out a property for each one
@client.account.queues.list.each do |queue|
  puts queue.average_wait_time
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Queue> queues = Queue.reader().read();

    // Loop over queues and print out a property for each one.
    for (Queue queue : queues) {
      System.out.println(queue.getAverageWaitTime());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues.list(function(err, data) {
    data.queues.forEach(function(queue) {
        console.log(queue.AverageWaitTime);
    });
});
出力を表示
  • JSON
  • XML
{
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues.json",
    "first_page_uri": "/2010-04-01/Accounts/AC5ef87.../Queues.json?Page=0&PageSize=50",
    "next_page_uri": "",
    "page": 0,
    "page_size": 50,
    "previous_page_uri": "",
    "queues": [
        {
            "average_wait_time": 0,
            "current_size": 0,
            "date_created": "Thu, 17 May 2012 23:50:39 +0000",
            "date_updated": "Thu, 17 May 2012 23:50:39 +0000",
            "friendly_name": "persistent_queue1",
            "max_size": 1000,
            "sid": "QUxxxxxxxxx",
            "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx.json"
        },
        { 
            "average_wait_time": 0,
            "current_size": 0,
            "date_created": "Thu, 26 Apr 2012 20:12:45 +0000",
            "date_updated": "Thu, 26 Apr 2012 20:12:45 +0000",
            "friendly_name": "persistent_queue2",
            "max_size": 100,
            "sid": "QUyyyyyyyyy",
            "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUyyyyyyyyy.json"
        }
    ]
}
<TwilioResponse>
    <Queues  [paging attributes]>
        <Queue>
            <Sid>QUxxxxxxxxx</Sid>
            <FriendlyName>persistent_queue1</FriendlyName>
            <CurrentSize>32</CurrentSize>
            <AverageWaitTime>140<AverageWaitTime>
            <MaxSize>1000</MaxSize>
            <DateCreated>2012-02-04 12:44:15</DateCreated>
            <DateUpdated>2012-02-05 17:33:44</DateUpdated>
        </Queue>
        <Queue>
            <Sid>QUyyyyyyyyy</Sid>
            <FriendlyName>persistent_queue2</FriendlyName>
            <CurrentSize>10</CurrentSize>
            <AverageWaitTime>140<AverageWaitTime>
            <MaxSize>100</MaxSize>
            <DateCreated>2012-02-04 12:44:15</DateCreated>
            <DateUpdated>2012-02-05 17:33:44</DateUpdated>
        </Queue>
    </Queues>
</TwilioResponse>
すべてのキューのリストの取得

HTTP POST

Queues リスト リソースに POST して、新しい Queue リソースを作成します。 作成時に、FriendlyName パラメーターと MaxSize パラメーターを指定します。

オプションパラメーター

以下のパラメーターを POST します。

パラメーター 説明
FriendlyName このキューのユニークな識別子です。
MaxSize このキューの最大サイズです。 デフォルトは 100 です。 最大値は 1000 です。
新しいキューの作成
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var queue = QueueResource.Create("newqueue");

        Console.WriteLine(queue.Sid);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$queue = $client->queues->create(
    array("friendlyName" => "newqueue")
);

echo $queue->sid;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

queue = client.queues.create("newqueue", )
print(queue.sid)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

queue = @client.account.queues.create(friendly_name: 'newqueue')

puts queue.average_wait_time
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json \
    -d "FriendlyName=newqueue" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues \
    -d "FriendlyName=newqueue" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.factory.QueueFactory;
import com.twilio.sdk.resource.instance.Queue;
import com.twilio.sdk.resource.list.QueueList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the QueueList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "newqueue"));
    
    QueueFactory queueFactory = client.getAccount().getQueueFactory();
    Queue queue = queueFactory.create(params);
    System.out.println(queue.getSid());
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

queue = client.queues.create(friendly_name="newqueue")
print(queue.sid)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues
  .create({friendlyName: 'newqueue'})
  .then((queue) => process.stdout.write(queue.sid));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var queue = twilio.CreateQueue("newqueue");
    
    Console.WriteLine(queue.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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

$queue = $client->account->queues->create("newqueue", array());
echo $queue->sid;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

queue = @client.account.queues.create(:friendly_name => "newqueue")
puts queue.average_wait_time
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    Queue queue = Queue.creator().setFriendlyName("newqueue").create();

    System.out.println(queue.getSid());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues.create({
    friendlyName: "newqueue"
}, function(err, queue) {
    process.stdout.write(queue.sid);
});
新しいキューの作成

HTTP PUT

サポートしません。

HTTP DELETE

サポートしません。

1 / 1
Loading Code Samples...
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var queue = QueueResource.Fetch("QU5ef8732a3c49700934481addd5ce1659");

        Console.WriteLine(queue.AverageWaitTime);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->fetch();

echo $queue->averageWaitTime;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

queue = client.queues.get("QU5ef8732a3c49700934481addd5ce1659")
print(queue.average_wait_time)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@queue = @client.account.queues('QU5ef8732a3c49700934481addd5ce1659').fetch

puts @queue.average_wait_time
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Queue;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = client.getAccount().getQueue("QU5ef8732a3c49700934481addd5ce1659");
    System.out.println(queue.getAverageWaitTime());
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

queue = client.queues("QU5ef8732a3c49700934481addd5ce1659") \
              .fetch()

print(queue.average_wait_time)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues('QU5ef8732a3c49700934481addd5ce1659')
  .fetch((queue) => console.log(queue));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var queue = twilio.GetQueue("QU5ef8732a3c49700934481addd5ce1659");
    
    Console.WriteLine(queue.AverageWaitTime);
  }
}
<?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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client->account->queues->get("QU5ef8732a3c49700934481addd5ce1659");
echo $queue->average_wait_time;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@queue = @client.account.queues.get("QU5ef8732a3c49700934481addd5ce1659")
puts @queue.average_wait_time
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = Queue.fetcher("QU5ef8732a3c49700934481addd5ce1659").fetch();

    System.out.println(queue.getAverageWaitTime());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues("QU5ef8732a3c49700934481addd5ce1659").get(function(err, queue) {
    console.log(queue.averageWaitTime);
});
{
    "sid": "QUxxxxxxxxx",
    "friendly_name": "persistent_queue1",
    "current_size": 0,
    "average_wait_time": 0,
    "max_size": 10,
    "date_created": "Mon, 26 Mar 2012 22:00:14 +0000",
    "date_updated": "Mon, 26 Mar 2012 22:00:14 +0000",
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx.json"
}
<TwilioResponse>
    <Queue>
        <Sid>QUxxxxxxxxx</Sid>
        <FriendlyName>persistent_queue1</FriendlyName>
        <CurrentSize>0</CurrentSize>
        <AverageWaitTime>0</AverageWaitTime>
        <MaxSize>10</MaxSize>
        <DateCreated>Mon, 26 Mar 2012 22:00:14 +0000</DateCreated>
        <DateUpdated>Mon, 26 Mar 2012 22:00:14 +0000</DateUpdated>
        <Uri>/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx</Uri>
    </Queue>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        QueueResource.Update("QU32a3c49700934481addd5ce1659f04d2", maxSize: 123);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->update(
        array("maxSize" => "123")
    );

echo $queue->averageWaitTime;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

queue = client.queues.update("QU32a3c49700934481addd5ce1659f04d2", max_size="123")
print(queue.average_wait_time)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@queue = @client.account.queues('QU32a3c49700934481addd5ce1659f04d2').fetch

@queue.update(max_size: '123')

puts @queue.average_wait_time
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU32a3c49700934481addd5ce1659f04d2.json \
    -d "MaxSize=123" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU32a3c49700934481addd5ce1659f04d2 \
    -d "MaxSize=123" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Queue;
import com.twilio.sdk.resource.list.QueueList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = client.getAccount().getQueue("QU32a3c49700934481addd5ce1659f04d2");
    // Build a filter for the QueueList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("MaxSize", "123"));
    queue.update(params); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

queue = client.queues("QU32a3c49700934481addd5ce1659f04d2") \
              .update(max_size="123")

print(queue.average_wait_time)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues('QU32a3c49700934481addd5ce1659f04d2')
  .update({maxSize: '123'})
  .then((queue) => console.log(queue.averageWaitTime));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken); 
    
    twilio.UpdateQueue("QU32a3c49700934481addd5ce1659f04d2", null, 123);
  }
}
<?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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$queue = $client->account->queues->get("QU32a3c49700934481addd5ce1659f04d2");
$queue->update(array(
        "MaxSize" => "123"
    ));
echo $queue->average_wait_time;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@queue = @client.account.queues.get("QU32a3c49700934481addd5ce1659f04d2")
@queue.update(:max_size => "123")
puts @queue.average_wait_time
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Queue queue = Queue.updater("QU32a3c49700934481addd5ce1659f04d2").setMaxSize(123).update();

    System.out.println(queue.getAverageWaitTime());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues("QU32a3c49700934481addd5ce1659f04d2").update({
    maxSize: "123"
}, function(err, queue) {
    console.log(queue.averageWaitTime);
});
{ 
    "average_wait_time": 0,
    "current_size": 0,
    "date_created": "Thu, 21 Jun 2012 23:55:36 +0000",
    "date_updated": "Fri, 22 Jun 2012 00:02:15 +0000",
    "friendly_name": "newqueue",
    "max_size": 123,
    "sid": "QUxxxxxxxxxxxx",
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxxxxx.json"
}
<TwilioResponse>
    <Queue>
        <Sid>QUxxxxxxxxxxxx</Sid>
        <FriendlyName>newqueue</FriendlyName>
        <CurrentSize>0</CurrentSize>
        <AvgWaitTime>0</AvgWaitTime>
        <MaxSize>123</MaxSize>
        <DateCreated>2012-06-21 23:55:36</DateCreated>
        <DateUpdated>2012-06-22 00:02:15</DateUpdated>
        <Uri>/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxxxxx</Uri>
    </Queue>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var queues = QueueResource.Read();

        foreach (var queue in queues)
        {
            Console.WriteLine(queue.AverageWaitTime);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of queues and echo a property for each one
foreach ($client->queues->read() as $queue) {
    echo $queue->averageWaitTime;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of queue objects with the properties described above
queues = client.queues.list()
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over queues and print out a property for each one
@client.account.queues.list.each do |queue|
  puts queue.average_wait_time
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Queue;
import com.twilio.sdk.resource.list.QueueList;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
 
    QueueList queues = client.getAccount().getQueues();
    
    // Loop over queues and print out a property for each one.
    for (Queue queue : queues) {
      System.out.println(queue.getAverageWaitTime());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of queue objects with the properties described above
for queue in client.queues.list():
    print(queue.average_wait_time)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues
  .each((queue) => console.log(queue.averageWaitTime));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var queues = twilio.ListQueues();
    
    foreach (var queue in queues.Queues)
    {
      Console.WriteLine(queue.AverageWaitTime);
    }
  }
}
<?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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of queues and echo a property for each one
foreach ($client->account->queues as $queue) {
    echo $queue->average_wait_time;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Loop over queues and print out a property for each one
@client.account.queues.list.each do |queue|
  puts queue.average_wait_time
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Queue> queues = Queue.reader().read();

    // Loop over queues and print out a property for each one.
    for (Queue queue : queues) {
      System.out.println(queue.getAverageWaitTime());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues.list(function(err, data) {
    data.queues.forEach(function(queue) {
        console.log(queue.AverageWaitTime);
    });
});
{
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues.json",
    "first_page_uri": "/2010-04-01/Accounts/AC5ef87.../Queues.json?Page=0&PageSize=50",
    "next_page_uri": "",
    "page": 0,
    "page_size": 50,
    "previous_page_uri": "",
    "queues": [
        {
            "average_wait_time": 0,
            "current_size": 0,
            "date_created": "Thu, 17 May 2012 23:50:39 +0000",
            "date_updated": "Thu, 17 May 2012 23:50:39 +0000",
            "friendly_name": "persistent_queue1",
            "max_size": 1000,
            "sid": "QUxxxxxxxxx",
            "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx.json"
        },
        { 
            "average_wait_time": 0,
            "current_size": 0,
            "date_created": "Thu, 26 Apr 2012 20:12:45 +0000",
            "date_updated": "Thu, 26 Apr 2012 20:12:45 +0000",
            "friendly_name": "persistent_queue2",
            "max_size": 100,
            "sid": "QUyyyyyyyyy",
            "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUyyyyyyyyy.json"
        }
    ]
}
<TwilioResponse>
    <Queues  [paging attributes]>
        <Queue>
            <Sid>QUxxxxxxxxx</Sid>
            <FriendlyName>persistent_queue1</FriendlyName>
            <CurrentSize>32</CurrentSize>
            <AverageWaitTime>140<AverageWaitTime>
            <MaxSize>1000</MaxSize>
            <DateCreated>2012-02-04 12:44:15</DateCreated>
            <DateUpdated>2012-02-05 17:33:44</DateUpdated>
        </Queue>
        <Queue>
            <Sid>QUyyyyyyyyy</Sid>
            <FriendlyName>persistent_queue2</FriendlyName>
            <CurrentSize>10</CurrentSize>
            <AverageWaitTime>140<AverageWaitTime>
            <MaxSize>100</MaxSize>
            <DateCreated>2012-02-04 12:44:15</DateCreated>
            <DateUpdated>2012-02-05 17:33:44</DateUpdated>
        </Queue>
    </Queues>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var queue = QueueResource.Create("newqueue");

        Console.WriteLine(queue.Sid);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$queue = $client->queues->create(
    array("friendlyName" => "newqueue")
);

echo $queue->sid;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

queue = client.queues.create("newqueue", )
print(queue.sid)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

queue = @client.account.queues.create(friendly_name: 'newqueue')

puts queue.average_wait_time
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues.json \
    -d "FriendlyName=newqueue" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues \
    -d "FriendlyName=newqueue" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.factory.QueueFactory;
import com.twilio.sdk.resource.instance.Queue;
import com.twilio.sdk.resource.list.QueueList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the QueueList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "newqueue"));
    
    QueueFactory queueFactory = client.getAccount().getQueueFactory();
    Queue queue = queueFactory.create(params);
    System.out.println(queue.getSid());
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

queue = client.queues.create(friendly_name="newqueue")
print(queue.sid)
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.queues
  .create({friendlyName: 'newqueue'})
  .then((queue) => process.stdout.write(queue.sid));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var queue = twilio.CreateQueue("newqueue");
    
    Console.WriteLine(queue.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
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

$queue = $client->account->queues->create("newqueue", array());
echo $queue->sid;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

queue = @client.account.queues.create(:friendly_name => "newqueue")
puts queue.average_wait_time
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Queue;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    Queue queue = Queue.creator().setFriendlyName("newqueue").create();

    System.out.println(queue.getSid());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.queues.create({
    friendlyName: "newqueue"
}, function(err, queue) {
    process.stdout.write(queue.sid);
});