import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.agents.test.sendTestMessage({
serviceName: "<value>",
source: "user@email.com",
text: "Hello",
testId: "<id>",
agentId: "<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.agents.test.send_test_message(request={
"service_name": "<value>",
"source": "user@email.com",
"text": "Hello",
"test_id": "<id>",
"agent_id": "<id>",
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/agents/test/messages \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"service_name": "<string>",
"source": "<string>",
"test_id": "<string>",
"agent_id": "<string>",
"text": "Hello",
"org_name": "<string>",
"override_timestamp": "<string>",
"session_start": false
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
service_name: '<string>',
source: '<string>',
test_id: '<string>',
agent_id: '<string>',
text: 'Hello',
org_name: '<string>',
override_timestamp: '<string>',
session_start: false
})
};
fetch('https://api.syllable.cloud/api/v1/agents/test/messages', 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/agents/test/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'service_name' => '<string>',
'source' => '<string>',
'test_id' => '<string>',
'agent_id' => '<string>',
'text' => 'Hello',
'org_name' => '<string>',
'override_timestamp' => '<string>',
'session_start' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.syllable.cloud/api/v1/agents/test/messages"
payload := strings.NewReader("{\n \"service_name\": \"<string>\",\n \"source\": \"<string>\",\n \"test_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"text\": \"Hello\",\n \"org_name\": \"<string>\",\n \"override_timestamp\": \"<string>\",\n \"session_start\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.syllable.cloud/api/v1/agents/test/messages")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"service_name\": \"<string>\",\n \"source\": \"<string>\",\n \"test_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"text\": \"Hello\",\n \"org_name\": \"<string>\",\n \"override_timestamp\": \"<string>\",\n \"session_start\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/agents/test/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service_name\": \"<string>\",\n \"source\": \"<string>\",\n \"test_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"text\": \"Hello\",\n \"org_name\": \"<string>\",\n \"override_timestamp\": \"<string>\",\n \"session_start\": false\n}"
response = http.request(request)
puts response.read_body{
"test_id": "<string>",
"agent_id": "<string>",
"response": "<unknown>",
"text": "<string>",
"response_text": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Send New Message
Send a new message
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.agents.test.sendTestMessage({
serviceName: "<value>",
source: "user@email.com",
text: "Hello",
testId: "<id>",
agentId: "<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.agents.test.send_test_message(request={
"service_name": "<value>",
"source": "user@email.com",
"text": "Hello",
"test_id": "<id>",
"agent_id": "<id>",
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/agents/test/messages \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"service_name": "<string>",
"source": "<string>",
"test_id": "<string>",
"agent_id": "<string>",
"text": "Hello",
"org_name": "<string>",
"override_timestamp": "<string>",
"session_start": false
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
service_name: '<string>',
source: '<string>',
test_id: '<string>',
agent_id: '<string>',
text: 'Hello',
org_name: '<string>',
override_timestamp: '<string>',
session_start: false
})
};
fetch('https://api.syllable.cloud/api/v1/agents/test/messages', 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/agents/test/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'service_name' => '<string>',
'source' => '<string>',
'test_id' => '<string>',
'agent_id' => '<string>',
'text' => 'Hello',
'org_name' => '<string>',
'override_timestamp' => '<string>',
'session_start' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.syllable.cloud/api/v1/agents/test/messages"
payload := strings.NewReader("{\n \"service_name\": \"<string>\",\n \"source\": \"<string>\",\n \"test_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"text\": \"Hello\",\n \"org_name\": \"<string>\",\n \"override_timestamp\": \"<string>\",\n \"session_start\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.syllable.cloud/api/v1/agents/test/messages")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"service_name\": \"<string>\",\n \"source\": \"<string>\",\n \"test_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"text\": \"Hello\",\n \"org_name\": \"<string>\",\n \"override_timestamp\": \"<string>\",\n \"session_start\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/agents/test/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service_name\": \"<string>\",\n \"source\": \"<string>\",\n \"test_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"text\": \"Hello\",\n \"org_name\": \"<string>\",\n \"override_timestamp\": \"<string>\",\n \"session_start\": false\n}"
response = http.request(request)
puts response.read_body{
"test_id": "<string>",
"agent_id": "<string>",
"response": "<unknown>",
"text": "<string>",
"response_text": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Message sent in a test chat with an agent.
Name of the service producing the message
Name of the source of the message - identifies the user, like an email or username.
"user@email.com"
Channel-manager-side ID of the session (see Session.channel_manager_sid)
ID of the agent with which the chat is taking place
The text of the message
"Hello"
Unused: Name of the organization associated with the agent
Override for the timestamp of the message
Whether this message is the start of a new session
Response
Successful Response
Response from an agent in a test chat.
Channel-manager-side ID of the session (see Session.channel_manager_sid)
ID of the agent with which the chat is taking place
The response from the agent
The text of the message that elicited the response
The text of the response

