import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.sessionLabels.create({
sessionId: 1,
type: "auto-rating",
code: "GOOD",
userEmail: "user@email.com",
issueCategories: [
"Silent treatment",
],
});
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.session_labels.create(request={
"session_id": 1,
"type": "auto-rating",
"code": "GOOD",
"user_email": "user@email.com",
"issue_categories": [
"Silent treatment",
],
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/session_labels/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"session_id": 1,
"type": "auto-rating",
"code": "GOOD",
"user_email": "user@email.com",
"comments": "<string>",
"issue_categories": [
"Silent treatment"
]
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session_id: 1,
type: 'auto-rating',
code: 'GOOD',
user_email: 'user@email.com',
comments: '<string>',
issue_categories: ['Silent treatment']
})
};
fetch('https://api.syllable.cloud/api/v1/session_labels/', 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/session_labels/",
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([
'session_id' => 1,
'type' => 'auto-rating',
'code' => 'GOOD',
'user_email' => 'user@email.com',
'comments' => '<string>',
'issue_categories' => [
'Silent treatment'
]
]),
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/session_labels/"
payload := strings.NewReader("{\n \"session_id\": 1,\n \"type\": \"auto-rating\",\n \"code\": \"GOOD\",\n \"user_email\": \"user@email.com\",\n \"comments\": \"<string>\",\n \"issue_categories\": [\n \"Silent treatment\"\n ]\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/session_labels/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": 1,\n \"type\": \"auto-rating\",\n \"code\": \"GOOD\",\n \"user_email\": \"user@email.com\",\n \"comments\": \"<string>\",\n \"issue_categories\": [\n \"Silent treatment\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/session_labels/")
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 \"session_id\": 1,\n \"type\": \"auto-rating\",\n \"code\": \"GOOD\",\n \"user_email\": \"user@email.com\",\n \"comments\": \"<string>\",\n \"issue_categories\": [\n \"Silent treatment\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"session_id": 1,
"type": "auto-rating",
"code": "GOOD",
"user_email": "user@email.com",
"id": 1,
"timestamp": "2024-01-01T12:00:00Z",
"comments": "<string>",
"issue_categories": [
"Silent treatment"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Label
Create a new label
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.sessionLabels.create({
sessionId: 1,
type: "auto-rating",
code: "GOOD",
userEmail: "user@email.com",
issueCategories: [
"Silent treatment",
],
});
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.session_labels.create(request={
"session_id": 1,
"type": "auto-rating",
"code": "GOOD",
"user_email": "user@email.com",
"issue_categories": [
"Silent treatment",
],
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/session_labels/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"session_id": 1,
"type": "auto-rating",
"code": "GOOD",
"user_email": "user@email.com",
"comments": "<string>",
"issue_categories": [
"Silent treatment"
]
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
session_id: 1,
type: 'auto-rating',
code: 'GOOD',
user_email: 'user@email.com',
comments: '<string>',
issue_categories: ['Silent treatment']
})
};
fetch('https://api.syllable.cloud/api/v1/session_labels/', 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/session_labels/",
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([
'session_id' => 1,
'type' => 'auto-rating',
'code' => 'GOOD',
'user_email' => 'user@email.com',
'comments' => '<string>',
'issue_categories' => [
'Silent treatment'
]
]),
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/session_labels/"
payload := strings.NewReader("{\n \"session_id\": 1,\n \"type\": \"auto-rating\",\n \"code\": \"GOOD\",\n \"user_email\": \"user@email.com\",\n \"comments\": \"<string>\",\n \"issue_categories\": [\n \"Silent treatment\"\n ]\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/session_labels/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": 1,\n \"type\": \"auto-rating\",\n \"code\": \"GOOD\",\n \"user_email\": \"user@email.com\",\n \"comments\": \"<string>\",\n \"issue_categories\": [\n \"Silent treatment\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/session_labels/")
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 \"session_id\": 1,\n \"type\": \"auto-rating\",\n \"code\": \"GOOD\",\n \"user_email\": \"user@email.com\",\n \"comments\": \"<string>\",\n \"issue_categories\": [\n \"Silent treatment\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"session_id": 1,
"type": "auto-rating",
"code": "GOOD",
"user_email": "user@email.com",
"id": 1,
"timestamp": "2024-01-01T12:00:00Z",
"comments": "<string>",
"issue_categories": [
"Silent treatment"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
The internal ID of the session (see Session.session_id)
1
The type of the label (either "auto-rating" or "human-rating")
"auto-rating"
"human-rating"
A code describing the quality of the labeled session (either "GOOD", "OK", "BAD", or "N/A")
"GOOD"
"OK"
"BAD"
"N/A"
The email of the user who created the label
"user@email.com"
Comment string describing additional details about the session
Descriptions of issues occurring in the labeled call
["Silent treatment"]
Response
Successful Response
Response model for session label operations. A session label is associated with a given session and contains an evaluation of quality and descriptions of issues the user encountered in that session or other details.
The internal ID of the session (see Session.session_id)
1
The type of the label (either "auto-rating" or "human-rating")
"auto-rating"
"human-rating"
A code describing the quality of the labeled session (either "GOOD", "OK", "BAD", or "N/A")
"GOOD"
"OK"
"BAD"
"N/A"
The email of the user who created the label
"user@email.com"
The internal ID of the label
1
The timestamp at which the label was created
"2024-01-01T12:00:00Z"
Comment string describing additional details about the session
Descriptions of issues occurring in the labeled call
["Silent treatment"]

