メニュー

Expand
ページを評価:

StyleSheet

StyleSheets enable you to give your Assistant a style by specifying its voice, error messages, success messages, and data collection validation behavior.

  • voice: the assistant's style for Programmable Voice.
    • say_voice: specify the assistant's text-to-speech voice.
  • collect: the assistant's style for the collect action.
    • validate: set which task the assistant should use if there is a failure when collecting data
      • on_failure: specify the message the assistant says when a question is answered with invalid input
      • on_success: specify the message the assistant says when a question is answered with valid input
      • max_attempts: the max number of times the assistant should attempt to collect data before redirecting to the on_failure task or URL.

All Autopilot REST API resources use the following base URL:

https://autopilot.twilio.com/v1/

Example Stylesheets data

{
	"style_sheet": {
		"voice": {
			"say_voice": "Polly.Salli-Neural"
		},
		"collect": {
			"validate": {
				"on_failure": {
					"messages": [
						{
							"say": "I'm sorry, can you please say that again"
						},
						{
							"say": "hmm I still didn't catch that, can you please repeat"
						},
						{
							"say": "Let's give it one more try. Please say it one more time"
						}
					],
					"repeat_question": false
				},
				"on_success": {
					"say": ""
				},
				"max_attempts": 4
			}
		}
	}
}

Selecting a voice for your bot

For bots deployed on Programmable Voice the voice attribute defines the text to speech voice used. Text to speech is the process that converts text (the text that you put in the say action) into a human-sounding voice. You can enter any of the en-US voices listed in the Text-to-Speech documentation.

StyleSheet properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that created the StyleSheet resource.

assistant_sid
sid<UA> Not PII

The SID of the Assistant that is the parent of the resource.

url
url Not PII

The absolute URL of the StyleSheet resource.

data
オブジェクト Not PII

The JSON string that describes the style sheet object.

Fetch a StyleSheet resource

GET
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/StyleSheet
パラメーター
Parameters in REST API format
assistant_sid
Path
GET sid_like<UA> Not PII

The SID of the Assistant that is the parent of the resource to fetch.

例 1
        
        
        
        

        Update a StyleSheet resource

        post
        https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/StyleSheet
        パラメーター
        Parameters in REST API format
        assistant_sid
        Path
        post sid_like<UA> Not PII

        The SID of the Assistant that is the parent of the resource to update.

        style_sheet
        オプション
        post オブジェクト Not PII

        The JSON string that describes the style sheet object.

        例 1
              
              
              
              
              ページを評価:

              ヘルプが必要ですか?

              誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

                    
                    
                    

                    フィードバックくださりありがとうございます!

                    We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    Refer us and get $10 in 3 simple steps!

                    ステップ1

                    Get link

                    Get a free personal referral link here

                    ステップ2:

                    Give $10

                    Your user signs up and upgrade using link

                    ステップ3

                    Get $10

                    1,250 free SMSes
                    OR 1,000 free voice mins
                    OR 12,000 chats
                    OR more