Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cognitive Engagement Center/ API Reference/ Call Center Configuration Interface Reference/ IVR Flow Management/ Uploading a TTS Template for Voice Notifications (createVoiceTemplate)

Uploading a TTS Template for Voice Notifications (createVoiceTemplate)

Updated on 2023-09-27 GMT+08:00

Scenario

Upload a TTS template for voice notifications.

Method

POST

URI

https://Domain name/apiaccess/rest/cc-management/v1/createVoiceTemplate (For example, the domain name is service.besclouds.com.)

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

Authorization

String

Yes

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

2

X-APP-Key

String

No

App key field, which is the user ID. Contact the operation personnel to obtain the app key.

Table 2 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1

requestBody

Object

No

-

1.1

name

String

Yes

Name of the TTS template file. The value can contain Chinese characters, digits, and uppercase and lowercase letters. The value contains a maximum of 50 characters.

1.2

scene

String

No

Application scenario.

The option is 3, indicating voice notification.

1.3

speed

Number

No

Speed of the converted voice. The value ranges from –200 to 500. If this parameter is left blank, the default value 0 is used.

1.4

volume

Number

No

Volume of the converted voice. The value ranges from 0 to 100. If this parameter is left blank, the default value 50 is used.

1.5

voicename

String

No

Timbre of the converted voice. The options are as follows:

  • cn_kefuman_common: graceful
  • cn_chengshuxing_common: mature
  • cn_roumeiqian_common: soft
  • cn_ziranzhen_common: natural
  • cn_tianmeiru_common: sweet

If this parameter is left blank, the default value cn_kefuman_common is used.

1.6

voicecontent

Object

Yes

Text content to be converted to voice.

1.6.1

textcontent

String

Yes

Text content. The value contains a maximum of 500 bytes.

The template content consists of fixed texts and variables. The template uses the UTF-8 encoding format. A Chinese character or symbol occupies three bytes. A letter, digit, or English symbol occupies one byte.

  • The template content cannot start with a variable.
  • The template content can contain a maximum of 500 bytes.
  • A variable can contain a maximum of 32 bytes. (If a variable contains more than 32 bytes, you are advised to split it into multiple variables.)

    The following variable formats are supported:

    • ${TXT_Digit}: String. Digit indicates the maximum length of the string. For example, ${TXT_9} indicates a string of a maximum of nine characters.
    • ${NUM_Digit}: Number. Digit indicates the maximum number of digits in the number. For example, ${NUM_6} indicates a number of a maximum of six digits.
    • ${DATE}: Date, in the format of YYYY/MM/DD. YYYY indicates the year, MM indicates the month, and DD indicates the day. An example is 2022/07/16.
    • ${TIME}: Time, in the format of HH:MM or HH:MM:SS. HH indicates the hour, MM indicates the minute, and SS indicates the second. Examples are 14:30 and 14:30:30.

Template examples:

  • Example 1: Dear ${TXT_8}, your initial password is ${NUM_6}.
  • Example 2: Please pick up your express delivery before ${TIME} on ${DATE}.
    NOTE:

    ${TIME} and ${DATE} must be separated by " on ".

1.6.2

language

String

Yes

Language.

  • zh_CN: Chinese
  • en_US: English
  • pt_BR: Portuguese
  • th_TH: Thai

1.7

callBackUrl

String

No

Callback URL. The system returns the review result to this URL.

The callback URL indicates the API defined by the customer for receiving the system review result. For details about the request and response parameters, see Table 3.

The callback URL must have been added to the IVR voice upload callback URL trustlist by the system administrator.

Table 3 Callback URL parameters

No.

Parameter

Type

Mandatory or Not

Description

Request parameters

1.7.1

fileUrl

String

Yes

Address of the file to be reviewed. The value is a full file address, including the file name extension.

1.7.2

fileId

String

Yes

ID of the file to be reviewed. For details about how to set this parameter, see the description of the templateId parameter in Table 4.

1.7.3

status

String

Yes

  • File review status. The options are as follows:
    • 2: approved
    • 3: rejected

1.7.4

comment

String

No

Review status remarks.

Response parameter

1.7.5

returnCode

String

Yes

Response code. The options are as follows:
  • 0: The review result is received successfully.
  • Others: The review result fails to be received.
    NOTE:

    If the review result fails to be received, the callback API is repeatedly invoked to return the file review result. After six times, the file review result is no longer returned.

Response Description

  • Response code: 200
Table 4 Response parameters

No.

Parameter

Type

Mandatory or Not

Description

1

schema

Object

Yes

-

1.1

returnCode

String

Yes

Result code. 0: success; other values: failure.

1.2

description

String

Yes

Description.

1.3

templateId

String

No

Template ID.

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

Request header:

Content-Type:application/json
Authorization:Bearer XXXXXXXXXXXXXXXXXXXXXXX
X-APP-Key:XXXXXXXXXXXXXXXXXXXXXXX

Request parameters:

{
     "name":"ctest1",
     "scene":"3",
     "volume":0,
    "speed":50,
     "voicename":"cn_kefuman_cn",
     "callBackUrl" : "http://10.134.227.74:18133/upload",
     "voicecontent":{
             "language":"en_US",
             "textcontent":"test"
     }
 }

Response parameters:

{
   "returnCode": "0",
   "description": "The file is uploaded successfully.",
   "templateId": "1249756280719641601"
 }

Callback URL parameters:

//Request parameters
{
    "fileUrl": "Y:/IVR/147/voice/0/nPqV9vU3_1666706957559.wav",
    "fileId": "1323606152730207249",
    "status": "2",
    "comment": "approved"
}
//Response parameters
{
    "returnCode": "0"
}

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback