Jump to content

TuCloudAPI addlocution

From Wiki 7Kas

TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: SuperRoot, Operator, Client.

ℹ Requires the 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

Create a locution / IVR. loc (the *40<loc> number, unique per tenant) auto-assigns to max+1 when 0. name required. waitext 1 = allow direct-dial extension. Each digit route validated in-tenant. NOTE: this does NOT create the audio file (upload is delegated to a media-server backend). Requires a non-readonly ukey.

Call

https://tucloudapi.7kas.com:9087/tucloud?func=addlocution&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.
name string Yes — Display name (required, max 32).
loc integer No 0 Locution number 1-999 (0 = auto max+1).
waitext integer No 1 1 = allow direct-dial extension, 0 = no.
ziro integer No 0 DTMF 0 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
one integer No 0 DTMF 1 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
two integer No 0 DTMF 2 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
three integer No 0 DTMF 3 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
four integer No 0 DTMF 4 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
five integer No 0 DTMF 5 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
six integer No 0 DTMF 6 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
seven integer No 0 DTMF 7 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
eight integer No 0 DTMF 8 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
nine integer No 0 DTMF 9 -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.
asterisk integer No 0 DTMF * -> Route _id to jump to when this DTMF key is pressed (0/blank = no branch); validated in-tenant.

Example

https://tucloudapi.7kas.com:9087/tucloud?func=addlocution&ukey=KEY&pbx=tucall&name=Bienvenida&one=197

Response

{ok, locution:{...}} or {ok:false,conflict}.

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