Tools
Test a webhook tool
Runs a webhook tool once with the arguments you give and answers with what the agent would hear. The request is exactly what a call sends, signature included, with X-Wixzel-Call-Id: test. Client tools run in your app, so they are tested from a call instead. Requires tools:write.
POST
/
v1
/
tools
/
{id}
/
test
Test a webhook tool
curl --request POST \
--url https://api.voice.wixzel.com/v1/tools/{id}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"arguments": {
"order_id": "A-1042"
}
}
'import requests
url = "https://api.voice.wixzel.com/v1/tools/{id}/test"
payload = { "arguments": { "order_id": "A-1042" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({arguments: {order_id: 'A-1042'}})
};
fetch('https://api.voice.wixzel.com/v1/tools/{id}/test', 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.voice.wixzel.com/v1/tools/{id}/test",
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([
'arguments' => [
'order_id' => 'A-1042'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.voice.wixzel.com/v1/tools/{id}/test"
payload := strings.NewReader("{\n \"arguments\": {\n \"order_id\": \"A-1042\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.voice.wixzel.com/v1/tools/{id}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"arguments\": {\n \"order_id\": \"A-1042\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voice.wixzel.com/v1/tools/{id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"arguments\": {\n \"order_id\": \"A-1042\"\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "tool_test",
"ok": true,
"status": 123,
"duration_ms": 123,
"output": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}Authorizations
Your Wixzel Voice API key: Authorization: Bearer wv_live_.... Keys are scoped; grant only what the integration needs.
Path Parameters
Pattern:
^[0-9a-f]{24}$Example:
"6a96a3ead6e886d42462dd3e"
Body
application/json
What the agent would pass.
Show child attributes
Show child attributes
Example:
{ "order_id": "A-1042" }
Response
What happened
⌘I
Test a webhook tool
curl --request POST \
--url https://api.voice.wixzel.com/v1/tools/{id}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"arguments": {
"order_id": "A-1042"
}
}
'import requests
url = "https://api.voice.wixzel.com/v1/tools/{id}/test"
payload = { "arguments": { "order_id": "A-1042" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({arguments: {order_id: 'A-1042'}})
};
fetch('https://api.voice.wixzel.com/v1/tools/{id}/test', 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.voice.wixzel.com/v1/tools/{id}/test",
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([
'arguments' => [
'order_id' => 'A-1042'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.voice.wixzel.com/v1/tools/{id}/test"
payload := strings.NewReader("{\n \"arguments\": {\n \"order_id\": \"A-1042\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.voice.wixzel.com/v1/tools/{id}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"arguments\": {\n \"order_id\": \"A-1042\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voice.wixzel.com/v1/tools/{id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"arguments\": {\n \"order_id\": \"A-1042\"\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "tool_test",
"ok": true,
"status": 123,
"duration_ms": 123,
"output": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "agent_not_found",
"message": "<string>",
"request_id": "req_01HXYZ...",
"param": "<string>",
"doc_url": "<string>"
}
}
