Uploading a TTS Template for Voice Notifications (createVoiceTemplate)
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
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. |
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:
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.
Template examples:
|
1.6.2 |
language |
String |
Yes |
Language.
|
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. |
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 |
|
1.7.4 |
comment |
String |
No |
Review status remarks. |
Response parameter |
||||
1.7.5 |
returnCode |
String |
Yes |
Response code. The options are as follows:
|
Response Description
- Response code: 200
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" }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot