import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.experiments.getById({
experimentId: 34744,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.experiments.get_by_id(experiment_id=34744)
# Handle response
print(res)curl --request GET \
--url https://api.syllable.cloud/api/v1/experiments/{experiment_id} \
--header 'Syllable-API-Key: <api-key>'const options = {method: 'GET', headers: {'Syllable-API-Key': '<api-key>'}};
fetch('https://api.syllable.cloud/api/v1/experiments/{experiment_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.syllable.cloud/api/v1/experiments/{experiment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Syllable-API-Key: <api-key>"
],
]);
$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.syllable.cloud/api/v1/experiments/{experiment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Syllable-API-Key", "<api-key>")
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.syllable.cloud/api/v1/experiments/{experiment_id}")
.header("Syllable-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/experiments/{experiment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Syllable-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Shorter greeting",
"target_id": 1,
"variants": [
{
"id": 1,
"name": "b",
"weight": 10,
"is_control": true,
"agent_id": 1,
"agent_name": "Front desk"
}
],
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_updated_by": "<string>",
"description": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"stopped_at": "2023-11-07T05:31:56Z",
"target": {
"id": 1,
"target": "+19995551234",
"target_mode": "voice",
"channel_id": 1,
"channel_name": "Main line"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Experiment By Id
Get an experiment by its ID
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.experiments.getById({
experimentId: 34744,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.experiments.get_by_id(experiment_id=34744)
# Handle response
print(res)curl --request GET \
--url https://api.syllable.cloud/api/v1/experiments/{experiment_id} \
--header 'Syllable-API-Key: <api-key>'const options = {method: 'GET', headers: {'Syllable-API-Key': '<api-key>'}};
fetch('https://api.syllable.cloud/api/v1/experiments/{experiment_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.syllable.cloud/api/v1/experiments/{experiment_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Syllable-API-Key: <api-key>"
],
]);
$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.syllable.cloud/api/v1/experiments/{experiment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Syllable-API-Key", "<api-key>")
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.syllable.cloud/api/v1/experiments/{experiment_id}")
.header("Syllable-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/experiments/{experiment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Syllable-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Shorter greeting",
"target_id": 1,
"variants": [
{
"id": 1,
"name": "b",
"weight": 10,
"is_control": true,
"agent_id": 1,
"agent_name": "Front desk"
}
],
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_updated_by": "<string>",
"description": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"stopped_at": "2023-11-07T05:31:56Z",
"target": {
"id": 1,
"target": "+19995551234",
"target_mode": "voice",
"channel_id": 1,
"channel_name": "Main line"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Response
Successful Response
Response model for experiment operations.
An experiment splits the traffic of one channel target between two or more agents, so that the agents can be compared on the same population. One variant is the control the others are measured against. Each variant is a weighted pointer to the agent that variant runs; the weights are relative and not percentages.
The internal ID of the experiment
1
The name of the experiment
"Shorter greeting"
The channel target being split, or null if that target has since been deleted. A running experiment always has one.
1
The variants of the experiment, in a stable order
Show child attributes
Show child attributes
draft, running, or stopped
draft, running, stopped When the experiment was created
When the experiment was last written
Who last wrote it
The hypothesis under test
When the experiment started
When the experiment stopped
The channel target being split, resolved for display. Null when the target has since been deleted, and when the read did not load it.
Show child attributes
Show child attributes

