Fetch a queue resource
Returns a single queue resource for the account by its QueueSid.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const queue = await client.texml.accounts.queues.retrieve('queue_sid', {
account_sid: 'account_sid',
});
console.log(queue.account_sid);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
queue = client.texml.accounts.queues.retrieve(
queue_sid="queue_sid",
account_sid="account_sid",
)
print(queue.account_sid)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
queue, err := client.Texml.Accounts.Queues.Get(
context.TODO(),
"queue_sid",
telnyx.TexmlAccountQueueGetParams{
AccountSid: "account_sid",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", queue.AccountSid)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.texml.accounts.queues.QueueRetrieveParams;
import com.telnyx.sdk.models.texml.accounts.queues.QueueRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
QueueRetrieveParams params = QueueRetrieveParams.builder()
.accountSid("account_sid")
.queueSid("queue_sid")
.build();
QueueRetrieveResponse queue = client.texml().accounts().queues().retrieve(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
queue = telnyx.texml.accounts.queues.retrieve("queue_sid", account_sid: "account_sid")
puts(queue)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$queue = $client->texml->accounts->queues->retrieve(
'queue_sid', accountSid: 'account_sid'
);
var_dump($queue);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:queues retrieve \
--api-key 'My API Key' \
--account-sid account_sid \
--queue-sid queue_sidcurl --request GET \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Queues/{queue_sid} \
--header 'Authorization: Bearer <token>'{
"account_sid": "4e71926f-8f13-450e-b91c-23c2ef786aa6",
"average_wait_time": 30,
"current_size": 3,
"date_created": "Fri, 27 Oct 2023 07:41:58 +0000",
"date_updated": "Fri, 27 Oct 2023 07:41:58 +0000",
"max_size": 10,
"sid": "my-queue",
"uri": "/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue.json",
"subresource_uris": {
"members": "/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue/Members.json"
}
}{
"errors": [
{
"detail": "Resource not found"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The UUID of the Telnyx account that owns the resource, for example f5586561-8ff0-4291-a51b-c7dfe4139ff9. The account_sid path segment is kept for Twilio API compatibility, but the value is a Telnyx account UUID, not a Twilio AC... SID. It must match the account that owns the API key used to authenticate the request, otherwise the endpoint returns 404. The same value is sent as AccountSid in TeXML webhooks.
"f5586561-8ff0-4291-a51b-c7dfe4139ff9"
The QueueSid that identifies the call queue.
Response
Queue resource.
The id of the account the resource belongs to.
"4e71926f-8f13-450e-b91c-23c2ef786aa6"
The average wait time in seconds for members in the queue.
30
The current number of members in the queue.
3
The timestamp of when the resource was created.
"Fri, 27 Oct 2023 07:41:58 +0000"
The timestamp of when the resource was last updated.
"Fri, 27 Oct 2023 07:41:58 +0000"
The maximum size of the queue.
10
The unique identifier of the queue.
"my-queue"
The relative URI for this queue.
"/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue.json"
A list of related resources identified by their relative URIs.
{
"members": "/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue/Members.json"
}
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const queue = await client.texml.accounts.queues.retrieve('queue_sid', {
account_sid: 'account_sid',
});
console.log(queue.account_sid);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
queue = client.texml.accounts.queues.retrieve(
queue_sid="queue_sid",
account_sid="account_sid",
)
print(queue.account_sid)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
queue, err := client.Texml.Accounts.Queues.Get(
context.TODO(),
"queue_sid",
telnyx.TexmlAccountQueueGetParams{
AccountSid: "account_sid",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", queue.AccountSid)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.texml.accounts.queues.QueueRetrieveParams;
import com.telnyx.sdk.models.texml.accounts.queues.QueueRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
QueueRetrieveParams params = QueueRetrieveParams.builder()
.accountSid("account_sid")
.queueSid("queue_sid")
.build();
QueueRetrieveResponse queue = client.texml().accounts().queues().retrieve(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
queue = telnyx.texml.accounts.queues.retrieve("queue_sid", account_sid: "account_sid")
puts(queue)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$queue = $client->texml->accounts->queues->retrieve(
'queue_sid', accountSid: 'account_sid'
);
var_dump($queue);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx texml:accounts:queues retrieve \
--api-key 'My API Key' \
--account-sid account_sid \
--queue-sid queue_sidcurl --request GET \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Queues/{queue_sid} \
--header 'Authorization: Bearer <token>'{
"account_sid": "4e71926f-8f13-450e-b91c-23c2ef786aa6",
"average_wait_time": 30,
"current_size": 3,
"date_created": "Fri, 27 Oct 2023 07:41:58 +0000",
"date_updated": "Fri, 27 Oct 2023 07:41:58 +0000",
"max_size": 10,
"sid": "my-queue",
"uri": "/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue.json",
"subresource_uris": {
"members": "/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue/Members.json"
}
}{
"errors": [
{
"detail": "Resource not found"
}
]
}