Skip to navigation

AddScenario

View as Markdown

Adds a new scenario to the Shared folder, so the scenario is available in all the existing applications. Please use the POST method.

When adding a scenario to the Shared folder, the application_id and application_name parameters should not be provided.

Allowed roles: Owner, Admin, Developer.

Example request: Add a new scenario: var s=‘hello’;

Authentication

AuthorizationBearer

Voximplant Management API uses signed JWT tokens generated from your service-account private key. Pass the token in the Authorization header as a Bearer value:

Authorization: Bearer $VOXIMPLANT_TOKEN

See Authorization for ready-to-copy snippets in bash, Python, Node.js and Go that turn your credentials.json into a token.

Query parameters

scenario_namestringRequired
The scenario name. The length should be less than 30
scenario_scriptstringOptional

The scenario text. Use the application/x-www-form-urlencoded content type with UTF-8 encoding. The length should be less than 128 KB

rule_idintegerOptional

The rule ID. The new scenario binds to the specified rule. Please note, if you do not bind the scenario to any rule, you cannot execute the scenario. Can be used instead of the rule_name parameter

rule_namestringOptional

The rule name. Can be used instead of the rule_id parameter

rewritebooleanOptionalDefaults to false
Whether to rewrite the existing scenario
application_idintegerOptional
Application ID to bind the scenario to
application_namestringOptional
Application name to bind the scenario to

Response

Successful response
resultintegerOptional
Returns 1 if the request has been completed successfully
scenario_idintegerOptional
The new scenario ID