CreateScript

Updated at:

Create a scenario.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

outboundbot:CreateScript

create

*Instance

acs:outboundbot:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

Instance ID

c46001bc-3ead-4bfd-9a69-4b5b66a4a3f4

ScriptName

string

Yes

Script name

课程满意度回访

ScriptDescription

string

No

Script description

课程回复话术

Industry

string

Yes

Industry

教育

Scene

string

Yes

Scenario

回访

ChatbotId

string

No

If the NluServiceType of the instance is Authorized or Provided, specify the ID of the chatbot instance to which the script needs to be attached using this field.

chatbot-cn-IfaUfqaUnb

AsrConfig

string

No

ASR configuration. Parameter definitions:

  • appKey: Alibaba Cloud account appKey.

  • maxEndSilence: Voice endpoint detection duration.

  • silenceTimeout: Silence timeout. Unit: seconds. The user times out after N seconds of silence.

  • engine: Invoke service; [ali, xunfei]

  • nlsServiceType: Invoke service type [Managed, Authorized]

  • engineXunfei: If the caller is xunfei, enter the corresponding configuration.

Note

If you select ali as the engine and Authorized as the nlsServiceType, a custom service is used, and the service provider is ali. If you select ali as the engine and Managed as the nlsServiceType, the default service is used. If you select xunfei as the engine and Authorized as the nlsServiceType, xunfei is the service provider. You must enter the xunfei configuration: {"uuid":"ed2xxxxxxxxx","globalMaxEndSilence":700,"globalMaxEndSilenceEnable":true}

  • globalMaxEndSilence: Silence detection. Unit: milliseconds.

  • globalMaxEndSilenceEnable: Silence detection switch. Enabled by default.

  • speechNoiseThreshold: Noise filtering threshold

{ "appKey": "oQDVNlE6fZ5mg46X", "engine": "ali", "engineXunfei": "", "globalMaxEndSilence": 700, "globalMaxEndSilenceEnable": true, "maxEndSilence": "500", "nlsServiceType": "Managed", "silenceTimeout": "5000", "speechNoiseThreshold": "0" }

TtsConfig

string

No

TTS configuration. Parameter definitions:

  • voice: Speaker.

  • volume: Volume. Value range: 0 to 100. Default value: 50.

  • speechRate: Speech rate. Value range: -500 to 500. Default value: 0.

  • pitchRate: Pitch rate. Value range: -500 to 500. Default value: 0.

  • globalInterruptible: Voice interruption configuration. -engine: Invoke service; [ali, volc, xunfei]. Large Language Model (LLM) scenarios do not support xunfei.

  • nlsServiceType: Service type. [Managed, Authorized]

  • engineXunfei: Configuration when the service provider is xunfei.

Note

1. If you select ali as the engine and Authorized as the nlsServiceType, a custom service is used. 2. If the service provider is ali, and you select ali as the engine and Managed as the nlsServiceType, the default service is used. 3. If you select xunfei as the engine (applicable to small model scenarios) and Authorized as the nlsServiceType, xunfei is the service provider. You must enter the engineXunfei configuration: {"pitchRate":50,"speechRate":50,"voice":"aisjiuxu","volume":50}. 4. If you select volc as the engine and Authorized as the nlsServiceType, it applies to doubao.

{ "appKey": "oQDVNlE6fZ5mg46X", "engine": "ali", "engineXunfei": "", "globalInterruptible": true, "nlsServiceType": "Managed", "pitchRate": "0", "speechRate": "0", "voice": "zhiyuan", "volume": "50" }

ScriptContent

array

No

For notification instances, pass in the script list. Deprecated.

[]

string

No

For notification instances, pass in the script list. Deprecated.

您好,您昨晚在李佳琦直播间下单的娜薇诗椰子水二代精华2支装还未付款,超时未支付会自动关闭订单,活动错过不再有奥。

ScriptWaveform

array

No

For notification instances, pass in the script voice list. Deprecated.

[]

string

No

For notification instances, pass in the script voice list. Deprecated.

[]

MiniPlaybackEnable

boolean

No

Connective phrase configuration switch (applicable to small models)

true

NewBargeInEnable

boolean

No

Graceful interruption configuration switch (applicable to small models)

true

LongWaitEnable

boolean

No

Intelligent sentence segmentation configuration switch (applicable to small models)

true

EmotionEnable

boolean

No

Emotion detection configuration switch (applicable to small models)

true

AgentKey

string

No

Robot workspace access Key

9137ab9c27044921860030adf8590ec4_p_outbound_public

AgentLlm

boolean

No

Is the robot workspace a Large Language Model (LLM) workspace?

false

AgentId

integer

No

Robot workspace ID

1198938

NluEngine

string

No

NLU engine (applicable only to Large Language Model (LLM) scenarios). This field is empty for non-LLM scenarios.

  • Prompts - Large Language Model (LLM) scenario,

  • SSE_FUNCTION - Function Compute pattern.

  • BeeBot - Workflow pattern.

Valid values:

  • Prompts :

    Text entry pattern

  • SSE_FUNCTION :

    Function Compute service pattern

Prompts

NluAccessType

string

No

NLU access method (applicable only to Large Language Model (LLM) scenarios). Enumeration: Managed - Access using an Alibaba public account. This field is empty for non-LLM scenarios.

Managed

ScriptNluProfileJsonString

string

No

Note

If nluEngine is SSE_FUNCTION, you must pass in the corresponding configuration.

Function Compute service pattern configuration

  • fcRegion: Function service region

  • fcFunction: Function service name

  • fcHttpTriggerUrl Function service trigger

{"fcRegion":"cn-shanghai","fcFunction":"waihu_test","fcHttpTriggerUrl":"https://waihu-test.xxxxxxxxxxx.cn-shanghai-vpc.fcapp.run"}

Response elements

Element

Type

Description

Example

object

HttpStatusCode

integer

HTTP status code

200

RequestId

string

Request ID

254EB995-DEDF-48A4-9101-9CA5B72FFBCC

Success

boolean

Indicates whether the operation was successful.

true

Code

string

Response code

OK

Message

string

API message

Success

Script

object

Script information

Status

string

Job status. Valid values:

  • DRAFTED: Draft.

  • INITIALIZE_IN_PROGRESS: Initializing.

  • PUBLISHED: Published.

  • PUBLISH_IN_PROGRESS: Publishing.

  • ROLLBACK_IN_PROGRESS: Rolling back.

  • EXAMINE_IN_PROGRESS: Pending review.

  • PUBLISHED_AND_EXAMINE_IN_PROGRESS: Published and pending review.

  • PUBLISH_FAILED: Publish failed.

  • ROLLBACK_FAILED: Rollback failed.

  • IMPORT_IN_PROGRESS: Importing.

  • IMPORT_FAILED: Import failed.

DRAFTED

UpdateTime

integer

Script update time (unit: milliseconds)

1578474045152

Industry

string

Industry

教育

ScriptDescription

string

Script description

课程满意度回访

IsDrafted

boolean

Is draft

true

DebugStatus

string

Script debug status

DRAFTED

ScriptId

string

Script ID

8c58d3e0-bf27-4685-a5a5-65872ec5abc4

IsDebugDrafted

boolean

Is debug draft

true

ScriptName

string

Script name

课程满意度回访

Scene

string

Scenario

回访

NluEngine

string

NLU engine (applicable only to Large Language Model (LLM) scenarios). Enumeration: Prompts - Large Language Model (LLM) scenario. This field is empty for non-LLM scenarios.

Prompts

NluAccessType

string

NLU access method (applicable only to Large Language Model (LLM) scenarios). Enumeration: Managed - Access using an Alibaba public account. This field is empty for non-LLM scenarios.

Managed

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "RequestId": "254EB995-DEDF-48A4-9101-9CA5B72FFBCC",
  "Success": true,
  "Code": "OK",
  "Message": "Success",
  "Script": {
    "Status": "DRAFTED",
    "UpdateTime": 1578474045152,
    "Industry": "教育",
    "ScriptDescription": "课程满意度回访",
    "IsDrafted": true,
    "DebugStatus": "DRAFTED",
    "ScriptId": "8c58d3e0-bf27-4685-a5a5-65872ec5abc4",
    "IsDebugDrafted": true,
    "ScriptName": "课程满意度回访",
    "Scene": "回访",
    "NluEngine": "Prompts",
    "NluAccessType": "Managed"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidScriptName.Duplicated The specified ScriptName already exists.
500 InternalError An error occurred while processing your request. Please try again later. Submit a ticket if the error still exists.
404 NotExist.Instance The specified Instance does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.