AddScenario

View as Markdown
Adds a new scenario to the <a href="https://voximplant.com/docs/gettingstarted/basicconcepts/scenarios#shared-scenarios">Shared</a> 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](/api-reference/management-api/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 must be less than 30
scenario_scriptstringOptional

The scenario text. Use the application/x-www-form-urlencoded content type with UTF-8 encoding. The length must 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
rule_namestringOptional

The rule name that can be used instead of rule_id

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
resultinteger
Returns 1 if the request has been completed successfully
scenario_idinteger
The new scenario ID