List assistant tests with pagination
Retrieves a paginated list of assistant tests with optional filtering capabilities
GET
/
ai
/
assistants
/
tests
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const assistantTest of client.ai.assistants.tests.list()) {
console.log(assistantTest.test_id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.ai.assistants.tests.list()
page = page.data[0]
print(page.test_id)
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"),
)
page, err := client.AI.Assistants.Tests.List(context.TODO(), telnyx.AIAssistantTestListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.tests.TestListPage;
import com.telnyx.sdk.models.ai.assistants.tests.TestListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TestListPage page = client.ai().assistants().tests().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.ai.assistants.tests.list
puts(page)<?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 {
$page = $client->ai->assistants->tests->list(
destination: 'destination',
pageNumber: 0,
pageSize: 0,
telnyxConversationChannel: 'telnyx_conversation_channel',
testSuite: 'test_suite',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tests list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/ai/assistants/tests \
--header 'Authorization: Bearer <token>'{
"meta": {
"total_pages": 123,
"total_results": 123,
"page_number": 123,
"page_size": 123
},
"data": [
{
"test_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Bot Test",
"telnyx_conversation_channel": "web_chat",
"rubric": [
{
"criteria": "Responds within 30 seconds",
"name": "Response Time"
}
],
"created_at": "2024-01-16T09:00:00Z",
"description": "<string>",
"destination": "<string>",
"max_duration_seconds": 123,
"test_suite": "<string>",
"instructions": "<string>"
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Filter tests by test suite name
Filter tests by communication channel (e.g., 'web_chat', 'sms')
Filter tests by destination (phone number, webhook URL, etc.)
Consolidated page parameter (deepObject style). Originally: page[size], page[number]
Show child attributes
Show child attributes
Response
Returns paginated test list with metadata for navigation and filtering
Paginated list of assistant tests with metadata.
Returns a subset of tests based on pagination parameters along with metadata for implementing pagination controls in the UI.
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const assistantTest of client.ai.assistants.tests.list()) {
console.log(assistantTest.test_id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.ai.assistants.tests.list()
page = page.data[0]
print(page.test_id)
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"),
)
page, err := client.AI.Assistants.Tests.List(context.TODO(), telnyx.AIAssistantTestListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.tests.TestListPage;
import com.telnyx.sdk.models.ai.assistants.tests.TestListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TestListPage page = client.ai().assistants().tests().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.ai.assistants.tests.list
puts(page)<?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 {
$page = $client->ai->assistants->tests->list(
destination: 'destination',
pageNumber: 0,
pageSize: 0,
telnyxConversationChannel: 'telnyx_conversation_channel',
testSuite: 'test_suite',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tests list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/ai/assistants/tests \
--header 'Authorization: Bearer <token>'{
"meta": {
"total_pages": 123,
"total_results": 123,
"page_number": 123,
"page_size": 123
},
"data": [
{
"test_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Bot Test",
"telnyx_conversation_channel": "web_chat",
"rubric": [
{
"criteria": "Responds within 30 seconds",
"name": "Response Time"
}
],
"created_at": "2024-01-16T09:00:00Z",
"description": "<string>",
"destination": "<string>",
"max_duration_seconds": 123,
"test_suite": "<string>",
"instructions": "<string>"
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}