Scenarios
Methods
AddScenario
Adds a new scenario. Please use the POST method.
Parameters
scenario_name:
string
The scenario name. The length must be less than 30
scenario_script:
string
OptionalThe scenario text. The length must be less than 128 KB.
rule_id:
number
OptionalThe rule ID.
rule_name:
string
OptionalThe rule name that can be used instead of rule_id.
rewrite:
boolean
OptionalDefaults on: falseRewrite the existing scenario.
Returns
result:
number
1
scenario_id:
number
The new scenario ID.
DelScenario
Deletes the scenario.
Parameters
scenario_id:
intlist
The scenario ID list separated by the ';' symbol or the 'all' value.
scenario_name:
stringlist
The scenario name list separated by the ';' symbol. Can be used instead of scenario_id.
Returns
result:
number
1
BindScenario
Bind the scenario list to the rule. You should specify the application_id or application_name if you specify the rule_name.
Parameters
scenario_id:
intlist
The scenario ID list separated by the ';' symbol.
scenario_name:
stringlist
The scenario name list separated by the ';' symbol. Can be used instead of scenario_id.
rule_id:
number
The rule ID.
rule_name:
string
The rule name that can be used instead of rule_id.
application_id:
number
The application ID.
application_name:
string
The application name that can be used instead of application_id.
bind:
boolean
OptionalDefaults on: trueBind or unbind (set true or false respectively).
Returns
result:
number
1
GetScenarios
Gets the account's scenarios.
Parameters
scenario_id:
number
OptionalThe scenario ID to filter
scenario_name:
string
OptionalThe scenario name to filter. Can be used instead of scenario_id. All scenarios containing this param in their names will be returned. The parameter is case insensitive.
with_script:
boolean
OptionalDefaults on: falseSet true to get the scenario text. You must specify the 'scenario_id' too!
count:
number
OptionalDefaults on: 20The max returning record count.
offset:
number
OptionalDefaults on: 0The first N records will be skipped in the output.
Returns
result:
total_count:
number
The total found scenario count.
count:
number
The returned scenario count.
SetScenarioInfo
Edits the scenario. Please use the POST method.
Parameters
scenario_id:
number
The scenario ID.
required_scenario_name:
string
The name of the scenario to edit, can be used instead of scenario_id.
scenario_name:
string
OptionalThe new scenario name. The length must be less than 30
scenario_script:
string
OptionalThe new scenario text. The length must be less than 128 KB.
Returns
result:
number
1
ReorderScenarios
Configures the order of scenarios that are assigned to the specified rule.
Parameters
rule_id:
number
The rule ID.
rule_name:
string
The rule name that can be used instead of rule_id.
scenario_id:
intlist
OptionalThe scenario ID list separated by the ';' symbol.
Returns
result:
number
1
StartScenarios
Runs JavaScript scenarios on a Voximplant server. The scenarios run in a new media session.
Parameters
user_id:
number
OptionalThe user ID. Run the scripts from the user if set.
user_name:
string
OptionalThe user name that can be used instead of user_id. Run the scripts from the user if set.
application_id:
number
OptionalThe application ID.
application_name:
string
OptionalThe application name that can be used instead of application_id.
rule_id:
number
The rule ID.
script_custom_data:
string
OptionalThe script custom data (like a script argument). Can be accessed in JS scenario via the VoxEngine.customData() method
reference_ip:
string
OptionalSpecifies the IP from the geolocation of predicted subscribers. It allows selecting the nearest server for serving subscribers.
Returns
result:
number
1
media_session_access_url:
string
The URL to control a created media session. It can be used for arbitrary tasks such as stopping scenario or passing additional data to it. Making HTTP request on this URL will result in the AppEvents.HttpRequest VoxEngine event being triggered for scenario, with HTTP request data passed to it.
media_session_access_secure_url:
string
The URL to control a created media session. It can be used for arbitrary tasks such as stopping scenario or passing additional data to it. Making HTTPS request on this URL will result in the AppEvents.HttpRequest VoxEngine event being triggered for scenario, with HTTP request data passed to it.
StartConference
Runs a session for video conferencing or joins the existing video conference session.
When a session is created by calling this method, a scenario assigned to the specified rule_id will run on one of the servers dedicated to video conferencing. All further method calls with the same rule_id won't create a new video conference session, but join the already existing one.
Use the StartScenarios method for creating audio conferences.
Parameters
conference_name:
string
The conference name. The name length must be less than 50 symbols.
rule_id:
number
The rule ID.
user_id:
number
OptionalThe user ID. Run the scripts from the user if set.
user_name:
string
OptionalThe user name that can be used instead of user_id. Run the scripts from the user if set.
application_id:
number
OptionalThe application ID.
application_name:
string
OptionalThe application name that can be used instead of application_id.
script_custom_data:
string
OptionalThe script custom data (like a script argument). Can be accessed in JS scenario via the VoxEngine.customData() method
reference_ip:
string
OptionalSpecifies the IP from the geolocation of predicted subscribers. It allows selecting the nearest server for serving subscribers.
Returns
result:
number
1
media_session_access_url:
string
The URL to control a created media session. It can be used for arbitrary tasks such as stopping scenario or passing additional data to it. Making HTTP request on this URL will result in the AppEvents.HttpRequest VoxEngine event being triggered for a scenario, with an HTTP request data passed to it.
media_session_access_secure_url:
string
The URL to control a created media session. It can be used for arbitrary tasks such as stopping scenario or passing additional data to it. Making HTTPS request on this URL will result in the AppEvents.HttpRequest VoxEngine event being triggered for a scenario, with an HTTP request data passed to it.