import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.sessions.transcript.getById({
sessionId: "<id>",
});
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.sessions.transcript.get_by_id(session_id="<id>")
# Handle response
print(res)curl --request GET \
--url https://api.syllable.cloud/api/v1/sessions/transcript/{session_id} \
--header 'Syllable-API-Key: <api-key>'const options = {method: 'GET', headers: {'Syllable-API-Key': '<api-key>'}};
fetch('https://api.syllable.cloud/api/v1/sessions/transcript/{session_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/sessions/transcript/{session_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/sessions/transcript/{session_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/sessions/transcript/{session_id}")
.header("Syllable-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/sessions/transcript/{session_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{
"session_id": "<string>",
"transcription": [
{
"timestamp": "2023-11-07T05:31:56Z",
"lang": "en-US",
"source": "user",
"text": "<string>",
"stt_confidence": {
"provider": "<string>",
"model": "<string>",
"utterance": 123,
"utterance_source": "provider",
"words": [
{
"word": "<string>",
"confidence": 123,
"start": 123,
"end": 123
}
],
"words_truncated": true
}
}
],
"actions": [
{
"timestamp": "2023-11-07T05:31:56Z",
"tool_name": "<string>",
"tool_request": "<string>",
"tool_result": "<string>",
"tool_error": "<string>",
"duration_ms": 123
}
],
"transcript_complete": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Session Transcript By Id
Return a session’s transcript, and whether it is complete.
Transcript records reach the logs database through an asynchronous pipeline, so a read taken
immediately after a session ends can return a short record. transcript_complete is true only
when everything the session reported writing is present, across both the spoken transcript and
the tool activity in actions. A caller that needs the whole record should re-request with
exponential backoff until it is true, or until its own time limit passes, keeping the last
response either way.
A time limit is required rather than optional. transcript_complete never turns true for a
session still in progress, for a session on a channel that reports no expected count (only
voice reports one today), or for a session that ended before the field was introduced - so a
caller polling without a limit would never stop.
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.sessions.transcript.getById({
sessionId: "<id>",
});
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.sessions.transcript.get_by_id(session_id="<id>")
# Handle response
print(res)curl --request GET \
--url https://api.syllable.cloud/api/v1/sessions/transcript/{session_id} \
--header 'Syllable-API-Key: <api-key>'const options = {method: 'GET', headers: {'Syllable-API-Key': '<api-key>'}};
fetch('https://api.syllable.cloud/api/v1/sessions/transcript/{session_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/sessions/transcript/{session_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/sessions/transcript/{session_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/sessions/transcript/{session_id}")
.header("Syllable-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/sessions/transcript/{session_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{
"session_id": "<string>",
"transcription": [
{
"timestamp": "2023-11-07T05:31:56Z",
"lang": "en-US",
"source": "user",
"text": "<string>",
"stt_confidence": {
"provider": "<string>",
"model": "<string>",
"utterance": 123,
"utterance_source": "provider",
"words": [
{
"word": "<string>",
"confidence": 123,
"start": 123,
"end": 123
}
],
"words_truncated": true
}
}
],
"actions": [
{
"timestamp": "2023-11-07T05:31:56Z",
"tool_name": "<string>",
"tool_request": "<string>",
"tool_result": "<string>",
"tool_error": "<string>",
"duration_ms": 123
}
],
"transcript_complete": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Response
Successful Response
Text transcript of a given session. For more information, see Console docs.
Internal ID of the session
Transcriptions of all messages in the session
Show child attributes
Show child attributes
Tool invocations that occurred during the session
Show child attributes
Show child attributes
True when every record the session reported writing is present, across both the spoken transcript and the tool activity in actions. False means the record cannot be confirmed complete. Callers should re-request until this is true, or until their own time limit passes. A limit is required rather than advisable, because three of the cases behind a False never turn true: a session still in progress, a session whose channel reports no expected count - only voice does today, so this is every web chat, SMS and email session - and any session that ended before this field was introduced.
true

