curl --request GET \
--url https://api.tela.com/test-case/{id}import requests
url = "https://api.tela.com/test-case/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/test-case/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tela.com/test-case/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/test-case/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tela.com/test-case/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/test-case/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"messages": [
{
"role": "user",
"content": "<string>"
}
],
"variables": {},
"variablesRichContent": {},
"files": [
{
"index": 123,
"name": "<string>",
"mimeType": "<string>",
"vaultUrl": "<string>",
"variableName": "<string>",
"url": "<string>"
}
],
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedOutput": "<string>",
"answers": {},
"promptApplicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"metadata": {
"source": "workstation"
},
"generations": [
"<unknown>"
]
}Get Test Case by ID
Retrieve a specific test case
curl --request GET \
--url https://api.tela.com/test-case/{id}import requests
url = "https://api.tela.com/test-case/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/test-case/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tela.com/test-case/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/test-case/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tela.com/test-case/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/test-case/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"messages": [
{
"role": "user",
"content": "<string>"
}
],
"variables": {},
"variablesRichContent": {},
"files": [
{
"index": 123,
"name": "<string>",
"mimeType": "<string>",
"vaultUrl": "<string>",
"variableName": "<string>",
"url": "<string>"
}
],
"promptId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expectedOutput": "<string>",
"answers": {},
"promptApplicationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"metadata": {
"source": "workstation"
},
"generations": [
"<unknown>"
]
}Retrieve a Test Case
const API_KEY = process.env.TELA_API_KEY;
const testCaseId = 'test_case_uuid';
const response = await fetch(`https://api.tela.ai/test-case/${testCaseId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
import requests
API_KEY = os.getenv('TELA_API_KEY')
test_case_id = 'test_case_uuid'
response = requests.get(
f'https://api.tela.ai/test-case/{test_case_id}',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}
)
print(response.json())
const API_KEY = process.env.TELA_API_KEY;
const testCaseId = 'test_case_uuid';
fetch(`https://api.tela.ai/test-case/${testCaseId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The UUID of the test case to retrieve |
Response
The response returns a single test case object with the following properties:| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the test case (UUID) |
title | string | Title of the test case |
messages | array or null | Array of message objects with role and content |
variables | object or null | Key-value pairs of variables used in the test case |
variablesRichContent | object or null | Key-value pairs of rich content variables |
files | array or null | Array of file objects attached to the test case |
promptId | string | UUID of the prompt this test case belongs to |
expectedOutput | string or null | Expected output for evaluation purposes |
answers | object or null | Evaluation answers with good/bad results and evals |
promptApplicationId | string or null | UUID of the prompt application if applicable |
metadata | object or null | Metadata about the test case including source |
createdAt | string | Creation timestamp |
updatedAt | string | Last update timestamp |
deletedAt | string or null | Deletion timestamp if applicable |
Example Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Customer Support Query Test",
"messages": [
{
"role": "system",
"content": "You are a helpful customer support assistant."
},
{
"role": "user",
"content": "My order hasn't arrived yet."
}
],
"variables": {
"customer_name": "John Doe",
"order_id": "ORD-12345"
},
"variablesRichContent": null,
"files": null,
"promptId": "550e8400-e29b-41d4-a716-446655440001",
"expectedOutput": "I'll help you track down your order, John. Let me look up order ORD-12345 for you.",
"answers": {
"version1": {
"good": [],
"bad": [],
"evals": []
}
},
"promptApplicationId": null,
"metadata": {
"source": "craft"
},
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-02T00:00:00.000Z",
"deletedAt": null
}
Path Parameters
Response
Test case details
Unique identifier for the test case
Title of the test case
Array of message objects with role and content
Show child attributes
Show child attributes
Key-value pairs of variables used in the test case
Show child attributes
Show child attributes
Key-value pairs of rich content variables
Show child attributes
Show child attributes
Array of file objects attached to the test case
Show child attributes
Show child attributes
UUID of the prompt this test case belongs to
Expected output for evaluation purposes
Evaluation answers with good/bad results and evals
Show child attributes
Show child attributes
UUID of the prompt application if applicable
Creation timestamp
Last update timestamp
Deletion timestamp if applicable
Metadata about the test case
Show child attributes
Show child attributes
Array of generations (only included if includeGenerations=true)