Crear una reseña de voz para un Woku (multipart)
curl --request POST \
--url https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form qualification=5 \
--form 'responseChannel=<string>' \
--form clientEmail=jsmith@example.com \
--form 'clientPhone=<string>'import requests
url = "https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"qualification": "5",
"responseChannel": "<string>",
"clientEmail": "jsmith@example.com",
"clientPhone": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('qualification', '5');
form.append('responseChannel', '<string>');
form.append('clientEmail', 'jsmith@example.com');
form.append('clientPhone', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails', 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://clientapi.woku.app/v1/wokus/{wokuId}/voicemails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://clientapi.woku.app/v1/wokus/{wokuId}/voicemails"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"message": "<string>",
"error": "Bad Request"
}{
"statusCode": 403,
"message": "Authentication required",
"error": "Forbidden"
}{
"statusCode": 404,
"message": "External tracker not found",
"error": "Not Found"
}Wokus
Crear una reseña de voz para un Woku (multipart)
Envia una reseña de voz para un Woku. El archivo de audio se sube como file en una solicitud multipart junto con la calificacion.
POST
/
v1
/
wokus
/
{wokuId}
/
voicemails
Crear una reseña de voz para un Woku (multipart)
curl --request POST \
--url https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form qualification=5 \
--form 'responseChannel=<string>' \
--form clientEmail=jsmith@example.com \
--form 'clientPhone=<string>'import requests
url = "https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"qualification": "5",
"responseChannel": "<string>",
"clientEmail": "jsmith@example.com",
"clientPhone": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('qualification', '5');
form.append('responseChannel', '<string>');
form.append('clientEmail', 'jsmith@example.com');
form.append('clientPhone', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails', 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://clientapi.woku.app/v1/wokus/{wokuId}/voicemails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://clientapi.woku.app/v1/wokus/{wokuId}/voicemails"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://clientapi.woku.app/v1/wokus/{wokuId}/voicemails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qualification\"\r\n\r\n5\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"responseChannel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientEmail\"\r\n\r\njsmith@example.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clientPhone\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"message": "<string>",
"error": "Bad Request"
}{
"statusCode": 403,
"message": "Authentication required",
"error": "Forbidden"
}{
"statusCode": 404,
"message": "External tracker not found",
"error": "Not Found"
}Autorizaciones
BearerAuthPublishableKey
Clave de API de la empresa. Obtenla desde tu panel de Woku en Configuracion > API Keys. La misma clave usada para los endpoints v0.
Parámetros de ruta
ObjectId de MongoDB del Woku.
Pattern:
^[0-9a-fA-F]{24}$Cuerpo
multipart/form-data
Archivo de audio para el mensaje de voz.
Opciones disponibles:
1, 2, 3, 4, 5 Ejemplo:
"5"
Canal de respuesta entrante opcional. El valor por defecto es 'api'; un valor indicado aqui lo REEMPLAZA (canal definido por el usuario).
Maximum string length:
48Opciones disponibles:
true, false Respuesta
Voicemail creado
⌘I