<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.7kas.com/index.php?action=history&amp;feed=atom&amp;title=TuCloudAPI_uploadlocution</id>
	<title>TuCloudAPI uploadlocution - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.7kas.com/index.php?action=history&amp;feed=atom&amp;title=TuCloudAPI_uploadlocution"/>
	<link rel="alternate" type="text/html" href="https://wiki.7kas.com/index.php?title=TuCloudAPI_uploadlocution&amp;action=history"/>
	<updated>2026-11-07T01:24:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.7kas.com/index.php?title=TuCloudAPI_uploadlocution&amp;diff=1226&amp;oldid=prev</id>
		<title>Maintenance script: TuCloudAPI reference regenerated from func=help: tenancy rule, pbx notes on every PBX-scoped function, error codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.7kas.com/index.php?title=TuCloudAPI_uploadlocution&amp;diff=1226&amp;oldid=prev"/>
		<updated>2026-10-08T21:17:11Z</updated>

		<summary type="html">&lt;p&gt;TuCloudAPI reference regenerated from func=help: tenancy rule, pbx notes on every PBX-scoped function, error codes&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: &amp;#039;&amp;#039;&amp;#039;SuperRoot, Operator, Client&amp;#039;&amp;#039;&amp;#039;.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Requires the &amp;lt;code&amp;gt;pbx&amp;lt;/code&amp;gt; parameter (the PBX &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;, e.g. &amp;lt;code&amp;gt;tucall&amp;lt;/code&amp;gt;). The server verifies that your &amp;lt;code&amp;gt;ukey&amp;lt;/code&amp;gt;&amp;#039;s own account owns that PBX, whatever its role; otherwise, and also for a PBX that does not exist, it returns &amp;lt;code&amp;gt;{&amp;quot;ok&amp;quot;:false,&amp;quot;code&amp;quot;:&amp;quot;forbidden&amp;quot;}&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
Sube un fichero de audio y lo deja COMO el audio de una locucion. El fichero va en el CUERPO de un POST, y el resto de parametros en la query. Se admiten dos envios: multipart/form-data (se toma la parte que declare filename=, el nombre del campo da igual) o el cuerpo entero como fichero con cualquier otro Content-Type. El servidor CONVIERTE siempre, sea cual sea el formato de entrada (wav, mp3, ogg, flac, m4a...), al unico que reproduce la centralita, y escribe en el arbol del root que corresponde a la PBX: el portal no decide formato ni ruta. NO sustituye la locucion: la deja PENDIENTE DE ACEPTAR y devuelve el audio YA CONVERTIDO en base64 para escucharlo. Aqui esto importa aun mas que en la sintesis, porque el audio se transcodifica a 8 kHz mono y lo que suena NO es lo que se subio: puede quedar bastante peor de lo esperado, y eso solo se juzga oyendolo. Se sustituye en commitlocution, y es ahi donde se retiran los formatos antiguos y se vacian tts_text/tts_voice. La pendiente CADUCA sola a los 60 minutos. Requiere ukey de escritura. Tamano maximo del cuerpo: [SERVICE] max_body_size (16 MB por omision); por encima se responde body_too_large.&lt;br /&gt;
&lt;br /&gt;
== Call ==&lt;br /&gt;
 https://tucloudapi.7kas.com:9087/tucloud?func=uploadlocution&amp;amp;ukey=YOUR_KEY&amp;amp;pbx=PBX_NAME&lt;br /&gt;
GET, or POST with the parameters form-urlencoded in the body. Requires the &amp;lt;code&amp;gt;ukey&amp;lt;/code&amp;gt; parameter. Always HTTP 200; the response is a JSON envelope.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Parameter !! Type !! Required !! Default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;pbx&amp;lt;/code&amp;gt; || string || Yes || — || FuturePBX NAME (e.g. tucall). The (ukey, pbx) pair is the tenant boundary; the server verifies the ukey owns this PBX.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; || integer || Yes || — || Id de la locucion (_id).&lt;br /&gt;
|}&lt;br /&gt;
== Example ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;curl -X POST -F &amp;quot;file=@aviso.mp3&amp;quot; &amp;quot;https://tucloudapi.7kas.com:9087/tucloud?func=uploadlocution&amp;amp;ukey=KEY&amp;amp;pbx=tucall&amp;amp;id=123&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Response ==&lt;br /&gt;
{ok, preview:{_id,source:&amp;quot;upload&amp;quot;,mime,format,bytes,seconds,expires_in_minutes,audio_url,audio_b64}} o {ok:false,invalid_param|not_found|no_file|bad_audio|io_error|body_too_large}.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
Always HTTP 200. On failure the body is &amp;lt;code&amp;gt;{&amp;quot;ok&amp;quot;:false,&amp;quot;code&amp;quot;:&amp;quot;...&amp;quot;,&amp;quot;message&amp;quot;:&amp;quot;...&amp;quot;}&amp;lt;/code&amp;gt;. Common codes: &amp;lt;code&amp;gt;missing_pbx&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;forbidden&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;invalid_param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not_found&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;conflict&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;in_use&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db_error&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;server_busy&amp;lt;/code&amp;gt;; the Response section above lists any specific to this function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[TuCloudAPI]]&lt;br /&gt;
[[Category:TuCloudAPI SuperRoot]][[Category:TuCloudAPI Operator]][[Category:TuCloudAPI Client]][[Category:TuCloudAPI]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>