REST API: Members

The Members list resource is a subresource of a Queue instance resource. It represents the set of members currently in a queue.

A Members instance resource represents an individual queue member. Each member is addressed by its CallSid.

Member Instance Resource

This resource represents a single queue Member, identified by a CallSid. Alternatively you can address the front of the Queue by specifying Front.

Resource URI

A specific call in the queue:

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

The front of the queue:

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

Resource Properties

A Member resource is represented by the following properties:

Property Description
CallSid A 34 character string that uniquely identifies the call that is enqueued.
DateEnqueued The date that the member was enqueued, given in RFC 2822 format.
WaitTime The number of seconds the member has been in the queue.
Position This member's current position in the queue.

HTTP GET

You can either get a specific member by pointing to a particular CallSid or the front of the queue by specifying Front.

Example
Get a Member Resource
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
<?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
$member = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->members("CA386025c9bf5d6052a1d1ea42b4d16662")
    ->fetch();

echo $member->waitTime;
<?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
$member = $client->account->queues->get('QU5ef8732a3c49700934481addd5ce1659')->members->get("CA386025c9bf5d6052a1d1ea42b4d16662");
echo $member->wait_time;
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members/CA386025c9bf5d6052a1d1ea42b4d16662 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.queue.Member;

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
    Member member =
        Member.fetch("QU5ef8732a3c49700934481addd5ce1659", "CA386025c9bf5d6052a1d1ea42b4d16662")
            .execute();

    System.out.println(member.getWaitTime());
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members/CA386025c9bf5d6052a1d1ea42b4d16662.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// 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 queueMember = twilio.GetQueueMember("QU5ef8732a3c49700934481addd5ce1659", "CA386025c9bf5d6052a1d1ea42b4d16662");
    
    Console.WriteLine(queueMember.WaitTime);
  }
}
// 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').members("CA386025c9bf5d6052a1d1ea42b4d16662").get(function(err, member) {
    console.log(member.waitTime);
});
# 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)

member = client.members('QU5ef8732a3c49700934481addd5ce1659').get("CA386025c9bf5d6052a1d1ea42b4d16662")
print(member.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
@member = @client.account.queues.get('QU5ef8732a3c49700934481addd5ce1659').members.get("CA386025c9bf5d6052a1d1ea42b4d16662")
puts @member.wait_time
// 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.Member;

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
    Member member = client.getAccount().getQueue("QU5ef8732a3c49700934481addd5ce1659").getMember("CA386025c9bf5d6052a1d1ea42b4d16662");
    System.out.println(member.getWaitTime());
    
  }
}
Show Output
  • JSON
  • XML
{
    "call_sid": "CA386025c9bf5d6052a1d1ea42b4d16662",
    "date_enqueued": "Mon, 4 Feb 2012 15:44:15 +0000",
    "wait_time": 30,
    "position": 1,
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx/Members/CA386025c9bf5d6052a1d1ea42b4d16662.json"
}
<TwilioResponse>
    <QueueMember>
        <CallSid>CAxxxxxxxx</CallSid>
        <DateEnqueued>2012-02-04 15:44:15</DateEnqueued>
        <WaitTime>30</WaitTime>
        <Position>1</Position>
    </QueueMember>
 </TwilioResponse>

HTTP POST

Posting a URL and Method to a Queue instance will dequeue a member from a queue and have the member's call begin executing the TwiML document at that URL.

You can address either an individual member by CallSid or the front of the queue by addressing Front.

When redirecting a member of a queue addressed by CallSid, only the first request will succeed and return a 200 response code. A second request will fail and return an appropriate 400 response code. When dequeuing the Front of the queue, the next call in the queue will be redirected.

Example 1: Dequeuing from the front of the queue
Dequeuing a Member from a Queue
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
<?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
$member = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->members("Front")
    ->update(
        "http://demo.twilio.com/docs/voice.xml",
        "POST"
    );

echo $member->waitTime;
<?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
$member = $client->account->queues->get('QU5ef8732a3c49700934481addd5ce1659')->members->get("Front");
$member->update(array(
        "Url" => "http://demo.twilio.com/docs/voice.xml",
    "Method" => "POST"
    ));
echo $member->wait_time;
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members/Front \
    -d "Url=http://demo.twilio.com/docs/voice.xml" \
    -d "Method=POST" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import java.net.URI;
import java.net.URISyntaxException;

import com.twilio.Twilio;
import com.twilio.http.HttpMethod;
import com.twilio.rest.api.v2010.account.queue.Member;

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 URISyntaxException {
    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
    Member member = Member.update("QU5ef8732a3c49700934481addd5ce1659", "Front",
        new URI("http://demo.twilio.com/docs/voice.xml"), HttpMethod.POST).execute();

    System.out.println(member.getDateEnqueued());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members/Front.json \
    -d "Url=http://demo.twilio.com/docs/voice.xml" \
    -d "Method=POST" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// 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.DequeueFirstQueueMember("QU5ef8732a3c49700934481addd5ce1659", "http://demo.twilio.com/docs/voice.xml", "POST");
  }
}
// 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').members("Front").update({
    url: "http://demo.twilio.com/docs/voice.xml",
    method: "POST"
}, function(err, member) {
    console.log(member.waitTime);
});
# 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)

member = client.members('QU5ef8732a3c49700934481addd5ce1659').dequeue("http://demo.twilio.com/docs/voice.xml", "Front", method="POST")
print(member.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
@member = @client.account.queues.get('QU5ef8732a3c49700934481addd5ce1659').members.get("Front")
@member.update(:url => "http://demo.twilio.com/docs/voice.xml",
    :method => "POST")
puts @member.wait_time
// 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.Member;
import com.twilio.sdk.resource.list.MemberList;
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
    Member member = client.getAccount().getQueue("QU5ef8732a3c49700934481addd5ce1659").getMember("Front");
    // Build a filter for the MemberList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
    params.add(new BasicNameValuePair("Method", "POST"));
    member.update(params);
    
  }
}
Show Output
  • JSON
  • XML
{
    "call_sid": "CA386025c9bf5d6052a1d1ea42b4d16662",
    "date_enqueued": "Mon, 4 Feb 2012 15:44:15 +0000",
    "wait_time": 30,
    "position" : 0,
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx/Members/CA386025c9bf5d6052a1d1ea42b4d16662.json"
}
<TwilioResponse>
    <QueueMember>
        <CallSid>CAxxxxxxxx</CallSid>
        <DateEnqueued>2012-02-04 15:44:15</DateEnqueued>
        <WaitTime>30</WaitTime>
        <Position>1</Position>
    </QueueMember>
 </TwilioResponse>
Dequeuing a Call
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
<?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
$member = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->members("CA5ef8732a3c49700934481addd5ce1659")
    ->update(
        "http://demo.twilio.com/docs/voice.xml",
        "POST"
    );

echo $member->position;
<?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
$member = $client->account->queues->get('QU5ef8732a3c49700934481addd5ce1659')->members->get("CA5ef8732a3c49700934481addd5ce1659");
$member->update(array(
        "Url" => "http://demo.twilio.com/docs/voice.xml",
    "Method" => "POST"
    ));
echo $member->position;
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members/CA5ef8732a3c49700934481addd5ce1659 \
    -d "Url=http://demo.twilio.com/docs/voice.xml" \
    -d "Method=POST" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import java.net.URI;
import java.net.URISyntaxException;

import com.twilio.Twilio;
import com.twilio.http.HttpMethod;
import com.twilio.rest.api.v2010.account.queue.Member;

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 URISyntaxException {
    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
    Member member =
        Member.update("QU5ef8732a3c49700934481addd5ce1659", "CA5ef8732a3c49700934481addd5ce1659",
            new URI("http://demo.twilio.com/docs/voice.xml"), HttpMethod.POST).execute();

    System.out.println(member.getDateEnqueued());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members/CA5ef8732a3c49700934481addd5ce1659.json \
    -d "Url=http://demo.twilio.com/docs/voice.xml" \
    -d "Method=POST" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// 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.DequeueQueueMember("QU5ef8732a3c49700934481addd5ce1659", "CA5ef8732a3c49700934481addd5ce1659", "http://demo.twilio.com/docs/voice.xml", "POST");
  }
}
// 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').members("CA5ef8732a3c49700934481addd5ce1659").update({
    url: "http://demo.twilio.com/docs/voice.xml",
    method: "POST"
}, function(err, member) {
    console.log(member.position);
});
# 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)

member = client.members('QU5ef8732a3c49700934481addd5ce1659').dequeue("http://demo.twilio.com/docs/voice.xml", "CA5ef8732a3c49700934481addd5ce1659", method="POST")
print(member.position)
# 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
@member = @client.account.queues.get('QU5ef8732a3c49700934481addd5ce1659').members.get("CA5ef8732a3c49700934481addd5ce1659")
@member.update(:url => "http://demo.twilio.com/docs/voice.xml",
    :method => "POST")
puts @member.position
// 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.Member;
import com.twilio.sdk.resource.list.MemberList;
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
    Member member = client.getAccount().getQueue("QU5ef8732a3c49700934481addd5ce1659").getMember("CA5ef8732a3c49700934481addd5ce1659");
    // Build a filter for the MemberList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
    params.add(new BasicNameValuePair("Method", "POST"));
    member.update(params);
    
  }
}
Show Output
  • JSON
  • XML
{
    "call_sid": "CA386025c9bf5d6052a1d1ea42b4d16662",
    "date_enqueued": "Mon, 4 Feb 2012 15:44:15 +0000",
    "wait_time": 30,
    "position": 0,
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxxx/Members/CA386025c9bf5d6052a1d1ea42b4d16662.json"
}
<TwilioResponse>
    <QueueMember>
        <CallSid>CAxxxxxxxx</CallSid>
        <DateEnqueued>2012-02-04 15:44:15</DateEnqueued>
        <WaitTime>30</WaitTime>
        <Position>0</Position>
    </QueueMember>
</TwilioResponse>

HTTP PUT

Not supported

HTTP DELETE

Not supported

Members List Resource

Resource URI

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

HTTP GET

Returns the list of members in the queue identified by {QueueSid}.

Example
List all Members from a Queue
  • C#
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • curl
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
<?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);

$members = $client
    ->queues("QU5ef8732a3c49700934481addd5ce1659")
    ->members
    ->read();

// Loop over the list of members and echo a property for each one
foreach ($members as $member) {
    echo $member->position;
}
<?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 members and echo a property for each one
foreach ($client->account->queues->get('QU5ef8732a3c49700934481addd5ce1659')->members as $member) {
    echo $member->position;
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// 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.Member;

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<Member> members = Member.read("QU5ef8732a3c49700934481addd5ce1659").execute();

    // Loop over members and print out a property for each one.
    for (Member member : members) {
      System.out.println(member.getPosition());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Queues/QU5ef8732a3c49700934481addd5ce1659/Members.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// 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 members = twilio.ListQueueMembers("QU5ef8732a3c49700934481addd5ce1659");
    
    foreach (var member in members.QueueMembers)
    {
      Console.WriteLine(member.WaitTime);
    }
  }
}
// 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').members.list(function(err, data) {
    data.queueMembers.forEach(function(member) {
        console.log(member.position);
    });
});
# 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 member objects with the properties described above
members = client.members('QU5ef8732a3c49700934481addd5ce1659').list()
# 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 members and print out a property for each one
@client.account.queues.get('QU5ef8732a3c49700934481addd5ce1659').members.list.each do |member|
    puts member.position
end
// 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.Member;
import com.twilio.sdk.resource.list.MemberList;

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);
    
    MemberList members = client.getAccount().getQueue("QU5ef8732a3c49700934481addd5ce1659").getMembers();
    
    // Loop over members and print out a property for each one.
    for (Member member : members) {
      System.out.println(member.getPosition());
    }
    
  }
}
Show Output
  • JSON
  • XML
{
    "page": 0,
    "page_size": 50,
    "first_page_uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxx/Members.json?Page=0&PageSize=50",
    "next_page_uri": null,
    "previous_page_uri": null,
    "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxx/Members.json",
    "queue_members": [
        {
            "call_sid": "CAxxxxxxxx",
            "date_enqueued": "Mon, 4 Feb 2012 15:44:15 +0000",
            "wait_time": 30,
            "position": 1,
            "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxx/Members/CAxxxxxxxx.json"
        },
        {
            "call_sid": "CAyyyyyyy",
            "date_enqueued": "Mon, 4 Feb 2012 15:44:30 +0000",
            "wait_time": 45,
            "position": 2,
            "uri": "/2010-04-01/Accounts/AC5ef87.../Queues/QUxxxxxxxx/Members/CAyyyyyyy.json"
        }
    ]
}
<TwilioResponse>
    <QueueMembers [paging attributes]>
        <QueueMember>
            <CallSid>CAxxxxxxxx</CallSid>
            <DateEnqueued>2012-02-04 15:44:15</DateEnqueued>
            <WaitTime>30</WaitTime>
            <Position>1</Position>
        </QueueMember>
        <QueueMember>
            <CallSid>CAyyyyyyy</CallSid>
            <DateEnqueued>2012-02-04 15:44:30</DateEnqueued>
            <WaitTime>45</WaitTime>
            <Position>2</Position>
        </QueueMember>
    </QueueMembers>
</TwilioResponse>

HTTP POST

Not supported

HTTP PUT

Not supported

HTTP DELETE

Not supported