import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.services.create({
name: "Weather tools",
description: "Service containing tools for fetching weather information",
authType: "basic",
authValues: {
"password": "my-password",
"username": "my-username",
},
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK, models
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.services.create(request={
"name": "Weather tools",
"description": "Service containing tools for fetching weather information",
"auth_type": models.ToolAuthType.BASIC,
"auth_values": {
"password": "my-password",
"username": "my-username",
},
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/services/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "Weather tools",
"description": "Service containing tools for fetching weather information",
"auth_type": "basic",
"auth_values": {
"password": "my-password",
"username": "my-username"
}
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weather tools',
description: 'Service containing tools for fetching weather information',
auth_type: 'basic',
auth_values: {password: 'my-password', username: 'my-username'}
})
};
fetch('https://api.syllable.cloud/api/v1/services/', 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/services/",
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([
'name' => 'Weather tools',
'description' => 'Service containing tools for fetching weather information',
'auth_type' => 'basic',
'auth_values' => [
'password' => 'my-password',
'username' => 'my-username'
]
]),
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/services/"
payload := strings.NewReader("{\n \"name\": \"Weather tools\",\n \"description\": \"Service containing tools for fetching weather information\",\n \"auth_type\": \"basic\",\n \"auth_values\": {\n \"password\": \"my-password\",\n \"username\": \"my-username\"\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/services/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weather tools\",\n \"description\": \"Service containing tools for fetching weather information\",\n \"auth_type\": \"basic\",\n \"auth_values\": {\n \"password\": \"my-password\",\n \"username\": \"my-username\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/services/")
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 \"name\": \"Weather tools\",\n \"description\": \"Service containing tools for fetching weather information\",\n \"auth_type\": \"basic\",\n \"auth_values\": {\n \"password\": \"my-password\",\n \"username\": \"my-username\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Weather tools",
"description": "Service containing tools for fetching weather information",
"last_updated": "2024-01-01T12:00:00Z",
"last_updated_by": "user@email.com",
"tools": [
"hangup",
"summary"
],
"auth_type": "basic",
"auth_value_keys": [
"username",
"password"
],
"last_updated_comments": "Updated description to correct typo"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Service
Create a new service.
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.services.create({
name: "Weather tools",
description: "Service containing tools for fetching weather information",
authType: "basic",
authValues: {
"password": "my-password",
"username": "my-username",
},
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK, models
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.services.create(request={
"name": "Weather tools",
"description": "Service containing tools for fetching weather information",
"auth_type": models.ToolAuthType.BASIC,
"auth_values": {
"password": "my-password",
"username": "my-username",
},
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/services/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"name": "Weather tools",
"description": "Service containing tools for fetching weather information",
"auth_type": "basic",
"auth_values": {
"password": "my-password",
"username": "my-username"
}
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weather tools',
description: 'Service containing tools for fetching weather information',
auth_type: 'basic',
auth_values: {password: 'my-password', username: 'my-username'}
})
};
fetch('https://api.syllable.cloud/api/v1/services/', 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/services/",
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([
'name' => 'Weather tools',
'description' => 'Service containing tools for fetching weather information',
'auth_type' => 'basic',
'auth_values' => [
'password' => 'my-password',
'username' => 'my-username'
]
]),
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/services/"
payload := strings.NewReader("{\n \"name\": \"Weather tools\",\n \"description\": \"Service containing tools for fetching weather information\",\n \"auth_type\": \"basic\",\n \"auth_values\": {\n \"password\": \"my-password\",\n \"username\": \"my-username\"\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/services/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weather tools\",\n \"description\": \"Service containing tools for fetching weather information\",\n \"auth_type\": \"basic\",\n \"auth_values\": {\n \"password\": \"my-password\",\n \"username\": \"my-username\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/services/")
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 \"name\": \"Weather tools\",\n \"description\": \"Service containing tools for fetching weather information\",\n \"auth_type\": \"basic\",\n \"auth_values\": {\n \"password\": \"my-password\",\n \"username\": \"my-username\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Weather tools",
"description": "Service containing tools for fetching weather information",
"last_updated": "2024-01-01T12:00:00Z",
"last_updated_by": "user@email.com",
"tools": [
"hangup",
"summary"
],
"auth_type": "basic",
"auth_value_keys": [
"username",
"password"
],
"last_updated_comments": "Updated description to correct typo"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Request model to create a service.
The name of the service
"Weather tools"
The description of the service
"Service containing tools for fetching weather information"
The type of authentication to use for the service's tools
basic, bearer, custom_headers, oauth2 "basic"
The values to use for the authentication, as a dict. Should contain "username" and "password" keys if auth type is basic, "token" key if auth type is bearer, arbitrary header keys if auth type is custom_headers. or "client_id", "client_secret", and "auth_url" keys if auth type is oauth2. On an update, leave a value for a given key null and the value in the database will not be updated. (If a key is omitted entirely, any existing value for that key will be removed.)
{
"password": "my-password",
"username": "my-username"
}
Response
Successful Response
Response model for service operations. A service is a collection of tools.
The internal ID of the service
1
The name of the service
"Weather tools"
The description of the service
"Service containing tools for fetching weather information"
The timestamp of the most recent update to the service
"2024-01-01T12:00:00Z"
The email of the user who last updated the service
"user@email.com"
Names of tools that belong to the service
["hangup", "summary"]
The type of authentication to use for the service's tools
basic, bearer, custom_headers, oauth2 "basic"
Auth value keys (values omitted for security)
["username", "password"]
Free text providing comment about what was updated
"Updated description to correct typo"

