TuCloudAPI synthlocution
TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: SuperRoot, Operator, Client.
pbx parameter (the PBX name, e.g. tucall). The server verifies that your ukey's own account owns that PBX, whatever its role; otherwise, and also for a PBX that does not exist, it returns {"ok":false,"code":"forbidden"}.Description
Genera el audio de una locucion a partir de un texto y lo deja PENDIENTE DE ACEPTAR: NO sustituye la locucion. El audio que suena hoy no se toca hasta que se llame a commitlocution. Se devuelve en la respuesta, en base64 y YA CONVERTIDO al formato de la centralita, para que lo que el usuario escucha sea exactamente lo que oiran quienes llamen. La pendiente CADUCA sola a los 60 minutos: el portal no tiene que ir detras borrandola. Requiere ukey de escritura. Una voz que ya no exista se RECHAZA con invalid_param, nunca se sustituye en silencio por otra. El texto y la voz se guardan en commitlocution, no aqui.
Call
https://tucloudapi.7kas.com:9087/tucloud?func=synthlocution&ukey=YOUR_KEY&pbx=PBX_NAME
GET, or POST with the parameters form-urlencoded in the body. Requires the ukey parameter. Always HTTP 200; the response is a JSON envelope.
Parameters
| Parameter | Type | Required | Default | Meaning |
|---|---|---|---|---|
pbx |
string | Yes | — | FuturePBX NAME (e.g. tucall). The (ukey, pbx) pair is the tenant boundary; the server verifies the ukey owns this PBX. |
id |
integer | Yes | — | Id de la locucion (_id). |
text |
string | Yes | — | Texto a locutar (max 2000). |
voice |
string | Yes | — | Id de voz del catalogo (getlocutionvoices). |
lang |
string | No | — | Codigo de idioma del catalogo. Orienta la sintesis; el motor deduce el idioma del propio texto, asi que no fuerza la pronunciacion. |
Example
https://tucloudapi.7kas.com:9087/tucloud?func=synthlocution&ukey=KEY&pbx=tucall&id=123&text=Bienvenido&voice=voz-01
Response
{ok, preview:{_id,source,text,voice,mime,format,bytes,seconds,expires_in_minutes,audio_url,audio_b64}} o {ok:false,invalid_param|not_found|upstream_error|io_error}. audio_b64 es null solo si el audio no cabe en linea; entonces se oye con audio_url.
Errors
Always HTTP 200. On failure the body is {"ok":false,"code":"...","message":"..."}. Common codes: missing_pbx, forbidden, invalid_param, not_found, conflict, in_use, db_error, server_busy; the Response section above lists any specific to this function.
Back to TuCloudAPI