### Go HTTP Client Example Source: https://docs.resemble.ai/api-reference/agents/get-system-tools This Go program illustrates how to make a GET request to the 'Get system tools' API endpoint. Replace '' with your valid API token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/agents/system-tools" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### List Audio Source Tracings (PHP) Source: https://docs.resemble.ai/api-reference/audio-source-tracing/list-audio-source-tracings This PHP example uses GuzzleHttp to send a GET request. Make sure to install Guzzle via Composer. ```php request('GET', 'https://app.resemble.ai/api/v2/audio_source_tracings?page=1', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Project Setup with Python Virtual Environment Source: https://docs.resemble.ai/guides/custom-voice-dataset/python Sets up a Python virtual environment, activates it, installs the Resemble library, and saves the dependencies. ```bash python3 -m venv venv source venv/bin/activate pip install resemble pip freeze > requirements.txt ``` -------------------------------- ### Go SDK Example for Get Transcript Question Source: https://docs.resemble.ai/api-reference/speech-to-text/get-transcript-question This Go program shows how to perform a GET request to retrieve a transcript question. It reads and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/speech-to-text/uuid/questions/question_uuid" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Get Project using Go Source: https://docs.resemble.ai/api-reference/projects/get-project Example of fetching project details with Go's standard net/http package. Remember to replace '' with your API key. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/projects/project_uuid" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Example cURL Request to Get Knowledge Item Source: https://docs.resemble.ai/agents/knowledge-base/get This example demonstrates how to use cURL to fetch a knowledge item. Replace YOUR_API_TOKEN with your actual API token. ```bash curl --request GET "https://app.resemble.ai/api/v2/knowledge_items/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Go HTTP Client Example Source: https://docs.resemble.ai/api-reference/clips/get-clip This Go program demonstrates how to make a GET request to retrieve clip information. Replace `` with your API credentials. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/projects/project_uuid/clips/clip_uuid" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Create Voice from Candidate Example Source: https://docs.resemble.ai/voice-creation/voice-design/design-overview An example of creating a voice from candidate #1, specifying the voice name as 'Tour Guide Voice'. This command uses a placeholder UUID 'abc123' and sample index '1'. ```bash curl 'https://app.resemble.ai/api/v2/voice-design/abc123/1/create_rapid_voice' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -F 'voice_name=Tour Guide Voice' ``` -------------------------------- ### Example: API Server Request Source: https://docs.resemble.ai/getting-started/authentication This example shows how to make a GET request to the API server to retrieve a list of voices using curl. Replace YOUR_API_KEY with your actual API key. ```bash curl 'https://app.resemble.ai/api/v2/voices' \ -H 'Authorization: Bearer YOUR_API_KEY' ``` -------------------------------- ### Example JSON Response for Get Tool Source: https://docs.resemble.ai/agents/tools/get This is a sample JSON response when successfully retrieving a tool. It includes details about the tool's configuration and metadata. ```json { "success": true, "item": { "id": 1, "name": "check_weather", "description": "Check weather for a given location", "tool_type": "webhook", "tool_config": { "api_schema": { "url": "https://api.weather.com/check", "method": "GET" }, "parameters": {}, "assignments": [], "response_timeout_secs": 30 }, "access_info": {}, "usage_stats": {}, "active": true, "created_at": "2025-01-27T10:00:00Z", "updated_at": "2025-01-27T10:00:00Z" } } ``` -------------------------------- ### List Audio Source Tracings (JavaScript) Source: https://docs.resemble.ai/api-reference/audio-source-tracing/list-audio-source-tracings Utilize the `fetch` API to perform a GET request. This example includes basic error handling for network issues. ```javascript const url = 'https://app.resemble.ai/api/v2/audio_source_tracings?page=1'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### Python SDK Example for Get Transcript Question Source: https://docs.resemble.ai/api-reference/speech-to-text/get-transcript-question Use this Python code to make a GET request to retrieve a transcript question. Ensure you have the requests library installed. ```python import requests url = "https://app.resemble.ai/api/v2/speech-to-text/uuid/questions/question_uuid" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Initialize Node.js Project and Install SDK Source: https://docs.resemble.ai/guides/custom-voice-dataset/nodejs Installs the necessary Node.js project configuration and the Resemble AI Node.js SDK. Ensure you have Node.js and npm installed. ```bash npm init -y npm install @resemble/node ``` -------------------------------- ### Get Voice Details using PHP GuzzleHttp Source: https://docs.resemble.ai/api-reference/voices/get-voice An example using the GuzzleHttp client in PHP to get voice details. Make sure to install Guzzle via Composer and insert your API token. ```php request('GET', 'https://app.resemble.ai/api/v2/voices/voice_uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` -------------------------------- ### Create Project using Go Source: https://docs.resemble.ai/api-reference/projects/create-project A Go program to create a new project. This example uses the standard 'net/http' package. Remember to replace '' with your authentication token. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/projects" payload := strings.NewReader("{\n \"name\": \"string\",\n \"description\": \"string\",\n \"is_collaborative\": true,\n \"is_archived\": true\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Go HTTP Client Example Source: https://docs.resemble.ai/api-reference/voices/build-voice A Go example for making a POST request to build a voice. Replace '' with your authentication token. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/voices/voice_uuid/build" payload := strings.NewReader("{}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Get Agent Tool using PHP GuzzleHttp Source: https://docs.resemble.ai/api-reference/agent-tools/get-agent-tool This PHP example utilizes the GuzzleHttp client to fetch agent tool details. Ensure you have the GuzzleHttp library installed and configured. ```php request('GET', 'https://app.resemble.ai/api/v2/agents/agent_uuid/tools/tool_uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### PHP Guzzle: Get Watermark Detection Result Source: https://docs.resemble.ai/api-reference/watermark/get-watermark-detection-result Retrieve watermark detection results with PHP using the Guzzle HTTP client. This example assumes Guzzle is installed via Composer. ```php request('GET', 'https://app.resemble.ai/api/v2/watermark/detect/uuid/result', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Go HTTP Client Example Source: https://docs.resemble.ai/api-reference/speech-to-text/ask-transcript-question This Go code demonstrates making an HTTP POST request to ask questions about transcripts. Replace with your API key. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/speech-to-text/uuid/ask" payload := strings.NewReader("{\n \"query\": \"What action items were mentioned?\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### List Agent Webhooks using PHP GuzzleHttp Source: https://docs.resemble.ai/api-reference/agent-webhooks/list-agent-webhooks This PHP example uses the GuzzleHttp client to make a GET request to list agent webhooks. It requires the GuzzleHttp library to be installed via Composer. ```php request('GET', 'https://app.resemble.ai/api/v2/agents/agent_uuid/webhooks', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Get Knowledge Item with PHP (Guzzle) Source: https://docs.resemble.ai/api-reference/agent-knowledge-base/get-knowledge-item This PHP example uses the Guzzle HTTP client to fetch a knowledge item. Make sure you have Guzzle installed via Composer. Replace '' with your API key. ```php request('GET', 'https://app.resemble.ai/api/v2/knowledge_items/uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` -------------------------------- ### Create Voice Settings Preset using Go Source: https://docs.resemble.ai/api-reference/voice-settings-presets/create-voice-settings-preset This Go code example shows how to create a voice settings preset. Remember to replace '' with your API key. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/voice_settings_presets" payload := strings.NewReader("{\n \"name\": \"string\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Get Audio Enhancement Status (PHP) Source: https://docs.resemble.ai/api-reference/audio-enhancement/get-audio-enhancement This PHP example uses the Guzzle HTTP client to retrieve audio enhancement status. Make sure you have Guzzle installed via Composer. Replace '' with your API token. ```php request('GET', 'https://app.resemble.ai/api/v2/audio_enhancements/enhancement_uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` -------------------------------- ### Workflow to Swap Knowledge Items Source: https://docs.resemble.ai/agents/knowledge-base/detach This example demonstrates the complete workflow for swapping knowledge items for an agent. It includes steps to check current items, detach an old item, attach a new item, and verify the changes. ```bash # Step 1: Check current knowledge items curl --request GET "https://app.resemble.ai/api/v2/agents/agent-uuid/knowledge_items" \ -H "Authorization: Bearer YOUR_API_TOKEN" # Response shows current items # Step 2: Detach old knowledge item curl --request DELETE "https://app.resemble.ai/api/v2/agents/agent-uuid/knowledge_items/old-uuid" \ -H "Authorization: Bearer YOUR_API_TOKEN" # Response: { "success": true, "message": "Knowledge item detached successfully" } # Step 3: Attach new knowledge item curl --request POST "https://app.resemble.ai/api/v2/agents/agent-uuid/knowledge_items" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ --data '{"knowledge_item_uuid": "new-uuid"}' # Response: { "success": true, "message": "Knowledge item attached successfully" } # Step 4: Verify new configuration curl --request GET "https://app.resemble.ai/api/v2/agents/agent-uuid/knowledge_items" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Get Agent Webhook (PHP) Source: https://docs.resemble.ai/api-reference/agent-webhooks/get-agent-webhook This PHP example utilizes the Guzzle HTTP client to retrieve agent webhook data. It requires the Guzzle library to be installed via Composer. Replace placeholders with your actual token and UUIDs. ```php request('GET', 'https://app.resemble.ai/api/v2/agents/agent_uuid/webhooks/webhook_uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Example cURL Request to Get Webhook Source: https://docs.resemble.ai/agents/webhooks/get An example using cURL to make a GET request to retrieve a webhook. Ensure you replace `YOUR_API_TOKEN` with your actual API token. ```bash curl --request GET "https://app.resemble.ai/api/v2/agents/550e8400-e29b-41d4-a716-446655440000/webhooks/1" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Create Agent using Go Source: https://docs.resemble.ai/api-reference/agents/create-agent Example of creating an agent using Go's standard http library. Remember to replace "" with your API key. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/agents" payload := strings.NewReader("{\n \"name\": \"string\",\n \"voice_uuid\": \"string\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Example cURL Request to Get Tool Source: https://docs.resemble.ai/agents/tools/get An example of how to use cURL to make a GET request to the tool endpoint. Ensure you replace placeholders with your actual agent UUID, tool ID, and API token. ```bash curl --request GET "https://app.resemble.ai/api/v2/agents/550e8400-e29b-41d4-a716-446655440000/tools/1" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Create Agent with System Tools Source: https://docs.resemble.ai/agents/create This example demonstrates how to create a customer support agent using the Resemble AI API. It includes configurations for agent name, voice, phone number, languages, dynamic variables, ASR settings, turn timeouts, LLM parameters, webhooks, and specifically configures the 'end_call' system tool. ```bash curl --request POST "https://app.resemble.ai/api/v2/agents" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ --data '{ \ "name": "Customer Support Agent", \ "voice_uuid": "abc123", \ "phone_number_id": 1, \ "languages": ["en-US"], \ "dynamic_variables": { \ "customer_name": "{{customer_name}}", \ "account_id": "{{account_id}}" \ }, \ "asr": { \ "provider": "deepgram", \ "model": "nova-2", \ "user_input_audio_format": "pcm_16000", \ "keywords": ["resemble", "account"] \ }, \ "turn": { \ "turn_timeout": 7, \ "silence_end_call_timeout": -1, \ "mode": "silence" \ }, \ "llm": { \ "prompt": "You are a helpful customer support agent.", \ "provider": "openai", \ "model": "gpt-4o", \ "temperature": 0.3, \ "timezone": "America/New_York" \ }, \ "webhooks": [ \ { \ "webhook_type": "pre_call", \ "webhook_config": { \ "api_schema": { \ "url": "https://example.com/pre-call", \ "method": "POST" \ }, \ "assignments": [] \ } \ } \ ], \ "system_tools": { \ "end_call": { \ "active": true, \ "disable_interruptions": false, \ "force_pre_tool_speech": false \ } \ } \ }' ``` -------------------------------- ### Get Account Response Example Source: https://docs.resemble.ai/api-reference/account/get-account This is an example of the JSON response received when successfully fetching account information. ```json { "success": true, "item": {} } ``` -------------------------------- ### Create Project Directory Source: https://docs.resemble.ai/guides/custom-voice-recordings/getting-started Set up a new project directory for cloning a voice using Resemble AI. ```bash mkdir resemble-clone-voice-recording cd resemble-clone-voice-recording ``` -------------------------------- ### Get Teams API Request in JavaScript (Fetch API) Source: https://docs.resemble.ai/api-reference/account/get-teams This JavaScript example uses the Fetch API to make a GET request to the Get Teams endpoint. Remember to substitute `` with your API key. ```javascript const url = 'https://app.resemble.ai/api/v2/account/teams'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### Python SDK Example Source: https://docs.resemble.ai/api-reference/agents/get-system-tools This Python script demonstrates how to call the 'Get system tools' API using the requests library. Ensure you replace '' with your actual API token. ```python import requests url = "https://app.resemble.ai/api/v2/agents/system-tools" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Get Teams API Response Example Source: https://docs.resemble.ai/api-reference/account/get-teams A sample JSON response for the Get Teams API request, indicating success and an array of team items. ```json { "success": true, "items": [ {} ] } ``` -------------------------------- ### Create Project Directory Source: https://docs.resemble.ai/guides/custom-voice-dataset/getting-started Sets up a new directory for your custom voice project and navigates into it. This is the first step in the project setup process. ```bash mkdir resemble-clone-voice cd resemble-clone-voice ``` -------------------------------- ### Get Recording using C# RestSharp Source: https://docs.resemble.ai/api-reference/recordings/get-recording This C# example uses the RestSharp library to perform the GET request. Add the RestSharp NuGet package to your project. ```csharp using RestSharp; var client = new RestClient("https://app.resemble.ai/api/v2/voices/voice_uuid/recordings/recording_id"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Create Agent Tool using Go HTTP Client Source: https://docs.resemble.ai/api-reference/agent-tools/create-agent-tool Create an agent tool using Go's standard net/http package. This example shows how to construct the POST request with necessary headers and payload. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/agents/agent_uuid/tools" payload := strings.NewReader("{\n \"name\": \"string\",\n \"description\": \"string\",\n \"tool_type\": \"webhook\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### PHP Guzzle Example Source: https://docs.resemble.ai/api-reference/voices/build-voice This PHP example utilizes the Guzzle HTTP client to build a voice. Ensure you have the Guzzle library installed and replace '' with your API token. ```php request('POST', 'https://app.resemble.ai/api/v2/voices/voice_uuid/build', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` -------------------------------- ### Go HTTP Client Example Source: https://docs.resemble.ai/api-reference/term-substitutions/create-term-substitution This Go code snippet shows how to make a POST request to create term substitutions. It includes setting headers and the JSON payload. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/term_substitutions" payload := strings.NewReader("{\n \"original_text\": \"string\",\n \"replacement_text\": \"string\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Go HTTP Client Example Source: https://docs.resemble.ai/api-reference/speech-to-text/get-transcript This Go code demonstrates how to make a GET request to the API to fetch a transcript. It prints both the HTTP response and the body. Remember to replace '' with your API key. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/speech-to-text/uuid" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### C# SDK Example for Get Transcript Question Source: https://docs.resemble.ai/api-reference/speech-to-text/get-transcript-question This C# code uses RestSharp to send a GET request for a transcript question. Configure your RestClient and RestRequest appropriately. ```csharp using RestSharp; var client = new RestClient("https://app.resemble.ai/api/v2/speech-to-text/uuid/questions/question_uuid"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Python SDK Example Source: https://docs.resemble.ai/api-reference/voices/build-voice Use this Python snippet to initiate a voice build request. Ensure you replace '' with your actual API token. ```python import requests url = "https://app.resemble.ai/api/v2/voices/voice_uuid/build" payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` -------------------------------- ### PHP SDK Example for Get Transcript Question Source: https://docs.resemble.ai/api-reference/speech-to-text/get-transcript-question This PHP example uses GuzzleHttp to retrieve a transcript question. Make sure to include the GuzzleHttp library via Composer. ```php request('GET', 'https://app.resemble.ai/api/v2/speech-to-text/uuid/questions/question_uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Install Resemble Node.js Client Source: https://docs.resemble.ai/guides/creating-clips/getting-started Install the official Resemble Node.js client library using npm. ```bash npm install @resemble/node ``` -------------------------------- ### Example: Synthesize Server Request Source: https://docs.resemble.ai/getting-started/authentication This example demonstrates how to make a POST request to the Synthesis server using curl. Ensure you replace YOUR_API_KEY and YOUR_VOICE_UUID with your specific values. ```bash curl --request POST "https://f.cluster.resemble.ai/synthesize" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ --data '{ \ "voice_uuid": "YOUR_VOICE_UUID", \ "data": "Hello from Resemble!" \ }' ``` -------------------------------- ### PHP Guzzle Example Source: https://docs.resemble.ai/api-reference/detect-intelligence/get-detect-intelligence-question This PHP example uses the Guzzle HTTP client to fetch detect intelligence question results. Make sure to install Guzzle via Composer. ```php request('GET', 'https://app.resemble.ai/api/v2/detects/uuid/intelligence/question_uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Create Agent Tool using Swift URLSession Source: https://docs.resemble.ai/api-reference/agent-tools/create-agent-tool This Swift example demonstrates creating an agent tool using URLSession. It shows how to set up the HTTP request with headers and the JSON body. ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "name": "string", "description": "string", "tool_type": "webhook" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://app.resemble.ai/api/v2/agents/agent_uuid/tools")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### List Agent Tools using Go HTTP Client Source: https://docs.resemble.ai/api-reference/agent-tools/list-agent-tools Example of how to list agent tools using Go's standard net/http package. Remember to replace '' with your API token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/agents/agent_uuid/tools" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Get Teams API Request in C# (RestSharp) Source: https://docs.resemble.ai/api-reference/account/get-teams A C# example using the RestSharp library to call the Get Teams API. Ensure you replace `` with your API token. ```csharp using RestSharp; var client = new RestClient("https://app.resemble.ai/api/v2/account/teams"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Get Billing Usage with C# (RestSharp) Source: https://docs.resemble.ai/api-reference/account/get-billing-usage This C# example uses the RestSharp library to make a GET request for billing usage. Replace '' with your actual API token. ```csharp using RestSharp; var client = new RestClient("https://app.resemble.ai/api/v2/account/billing_usage"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Get Account using C# RestSharp Source: https://docs.resemble.ai/api-reference/account/get-account This C# example utilizes the RestSharp library to make a GET request for account data. It configures the client and request with the necessary headers. ```csharp using RestSharp; var client = new RestClient("https://app.resemble.ai/api/v2/account"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Post-Call Webhook Example Source: https://docs.resemble.ai/agents/webhooks/create This example demonstrates how to set up a post-call webhook. It specifies the webhook type, configuration details including the API schema for the external service, and a response timeout. ```APIDOC ## Post-Call Webhook Example ### Description This endpoint allows you to configure a webhook that triggers after a call is completed. You can specify the URL, HTTP method, headers, and request body for the external service that will receive the call data. ### Method POST ### Endpoint `/api/v2/agents/{agent_id}/webhooks` ### Parameters #### Path Parameters - **agent_id** (string) - Required - The unique identifier of the agent. #### Request Body - **webhook_type** (string) - Required - Specifies the type of webhook, e.g., "post_call". - **webhook_config** (object) - Required - Configuration for the webhook. - **api_schema** (object) - Required - Defines the schema for the API call to be made by the webhook. - **url** (string) - Required - The HTTP/HTTPS URL to send the webhook request to. - **method** (string) - Required - The HTTP method to use (e.g., "POST"). - **request_headers** (object) - Optional - Key-value pairs for HTTP request headers. - **request_body** (object) - Optional - The structure of the request body to be sent. - **response_timeout_secs** (integer) - Optional - The timeout in seconds for the webhook response. ### Request Example ```json { "webhook_type": "post_call", "webhook_config": { "api_schema": { "url": "https://api.example.com/post-call", "method": "POST", "request_headers": { "Authorization": "Bearer secret123" }, "request_body": { "conversation_uuid": "{{conversation_uuid}}", "duration_seconds": "{{call_duration}}", "summary": "{{call_summary}}" } }, "response_timeout_secs": 5 } } ``` ``` -------------------------------- ### Ruby Net::HTTP Example Source: https://docs.resemble.ai/api-reference/custom-pronunciations/get-pronunciation This Ruby example uses the Net::HTTP library to make a GET request to the pronunciation API. It includes setting the Authorization header with your Bearer token. ```ruby require 'uri' require 'net/http' url = URI("https://app.resemble.ai/api/v2/pronunciations/uuid") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### JavaScript Fetch API Example Source: https://docs.resemble.ai/api-reference/agent-phone-numbers/get-phone-number This JavaScript example uses the Fetch API to get agent phone number details. Remember to substitute "" with your API key. ```javascript const url = 'https://app.resemble.ai/api/v2/phone_numbers/1'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### List Audio Enhancements (Go) Source: https://docs.resemble.ai/api-reference/audio-enhancement/list-audio-enhancements A Go program to list audio enhancements. This example shows how to make a GET request and print the response body. Remember to replace '' with your API key. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/audio_enhancements?page=1" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Get Clip Request Example Source: https://docs.resemble.ai/platform-management/clips/get Use this cURL command to make a GET request to retrieve a specific clip. Replace placeholders with your actual project and clip UUIDs, and your API token. ```bash curl 'https://app.resemble.ai/api/v2/projects/PROJECT_UUID/clips/CLIP_UUID' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### Retrieve Audio Source Tracing with Go Source: https://docs.resemble.ai/api-reference/audio-source-tracing/get-audio-source-tracing This Go code example shows how to perform a GET request to retrieve audio source tracing information. Replace "" with your valid API token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/audio_source_tracings/uuid" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### JavaScript Fetch API: Get Watermark Result Source: https://docs.resemble.ai/api-reference/watermark/get-watermark-apply-result Retrieve the watermark application result using the JavaScript Fetch API. This example demonstrates making a GET request with an authorization header. ```javascript const url = 'https://app.resemble.ai/api/v2/watermark/apply/uuid/result'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### Create Project using JavaScript (Fetch API) Source: https://docs.resemble.ai/api-reference/projects/create-project This JavaScript snippet demonstrates creating a project using the Fetch API. Replace '' with your API key and ensure your environment supports async/await. ```javascript const url = 'https://app.resemble.ai/api/v2/projects'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"name":"string","description":"string","is_collaborative":true,"is_archived":true}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### Get Teams API Request in Java (Unirest) Source: https://docs.resemble.ai/api-reference/account/get-teams Example of how to call the Get Teams API using the Unirest library in Java. Remember to replace `` with your valid API token. ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.resemble.ai/api/v2/account/teams") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### Get Account using Java Unirest Source: https://docs.resemble.ai/api-reference/account/get-account This Java example uses the Unirest library to make a GET request to the account endpoint. Ensure the Unirest library is included in your project dependencies. ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.resemble.ai/api/v2/account") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### Go HTTP Client Example Source: https://docs.resemble.ai/api-reference/custom-pronunciations/get-pronunciation Fetch pronunciation details using Go's standard net/http package. This code snippet shows how to construct the request, add the authorization header, and print the response body. Replace "" with your API credentials. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.resemble.ai/api/v2/pronunciations/uuid" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### PHP Guzzle Example Source: https://docs.resemble.ai/api-reference/speech-to-text/get-transcript This PHP example utilizes the Guzzle HTTP client to fetch transcript data. Make sure Guzzle is installed via Composer. Replace '' with your API key. ```php request('GET', 'https://app.resemble.ai/api/v2/speech-to-text/uuid', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Create Project using Java (Unirest) Source: https://docs.resemble.ai/api-reference/projects/create-project Example of creating a project using the Unirest library in Java. Make sure to include the Unirest dependency in your project and substitute '' with your actual API token. ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://app.resemble.ai/api/v2/projects") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"name\": \"string\",\n \"description\": \"string\",\n \"is_collaborative\": true,\n \"is_archived\": true\n}") .asString(); ``` -------------------------------- ### Create Project using Ruby Source: https://docs.resemble.ai/api-reference/projects/create-project This Ruby script shows how to create a project using Net::HTTP. Replace '' with your API key and ensure you have the 'uri' and 'net/http' libraries available. ```ruby require 'uri' require 'net/http' url = URI("https://app.resemble.ai/api/v2/projects") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"string\",\n \"description\": \"string\",\n \"is_collaborative\": true,\n \"is_archived\": true\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Java SDK Example for Get Transcript Question Source: https://docs.resemble.ai/api-reference/speech-to-text/get-transcript-question This Java code snippet uses the Unirest library to make a GET request for a transcript question. Ensure Unirest is included in your project dependencies. ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.resemble.ai/api/v2/speech-to-text/uuid/questions/question_uuid") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### Speech-to-Speech Conversion with Prompt Source: https://docs.resemble.ai/voice-generation/speech-to-speech This example shows how to use the `prompt` attribute within the `` tag for speech-to-speech synthesis. The prompt guides the delivery style, accent, or tone of the converted speech, applied directly to the conversion tag. ```bash curl --request POST "https://f.cluster.resemble.ai/synthesize" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ --data '{ \ "voice_uuid": "55592656", \ "data": "", \ "sample_rate": 48000, \ "output_format": "wav" \ }' ```