ModifySmartSubtitleTemplate
Last updated: 2025-12-02 14:26:57Download PDF
1. API Description
Domain name for API request: mps.intl.tencentcloudapi.com.
This API is used to modify a user-defined smart subtitle template.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.
2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: ModifySmartSubtitleTemplate. |
| Version | Yes | String | Common Params. The value used for this API: 2019-06-12. |
| Region | No | String | Common Params. This parameter is not required for this API. |
| Definition | Yes | Integer | Unique identifier of the smart subtitle template. |
| TranslateSwitch | No | String | Subtitle translation switch.ON: translation enabled.OFF: translation disabled.Note: For pure subtitle translation mode, the default value is enabled if the field is unspecified. The field cannot be left blank or set to OFF. |
| Name | No | String | Smart subtitle template name. Length limit: 64 characters. |
| Comment | No | String | Smart subtitle template description. Length limit: 256 characters. |
| VideoSrcLanguage | No | String | Source language of the video with smart subtitles. Currently, the following languages are supported: zh: Simplified Chinese.yue: Cantonese.zh-PY: Chinese, English, and Cantonese.zh_medical: Chinese (medical scenario).zh_dialect: Chinese dialect.prime_zh: Chinese, English, and Chinese dialects.zh_en: Chinese and English.en: English.ja: Japanese.ko: Korean.fr: French.es: Spanish.it: Italian.de: German.tr: Turkish.ru: Russian.pt: Portuguese (Brazil).pt-PT: Portuguese (Portugal).vi: Vietnamese.id: Indonesian.ms: Malay.th: Thai.ar: Arabic.hi: Hindi.fil: Filipino.auto: automatic recognition (it is only supported in pure subtitle translation). |
| SubtitleFormat | No | String | Smart subtitle file format: - Under the ASR recognition and translation processing type: - vtt: WebVTT format subtitle. - srt: SRT format subtitle. - Unspecified or left blank: no subtitle file generated. - Under the pure subtitle translation processing type: - original: consistent with the source file. - vtt: WebVTT format subtitle. - srt: SRT format subtitle. Note: - For ASR recognition mode, when 2 or more languages are involved in translation, this field cannot be unspecified or left blank. - For pure subtitle translation mode, this field cannot be unspecified or left blank. |
| SubtitleType | No | Integer | Smart subtitle language type. 0: source language 1: target language 2: source language + target language The value can only be 0 when TranslateSwitch is set to OFF. The value can only be 1 or 2 when TranslateSwitch is set to ON. |
| AsrHotWordsConfigure | No | AsrHotWordsConfigure | ASR hotword lexicon parameter. |
| TranslateDstLanguage | No | String | Target language for subtitle translation. This field is valid when the value of TranslateSwitch is ON. Currently, the following languages are supported: zh: Simplified Chinese.zh-TW: Traditional Chinese.en: English.ja: Japanese.ko: Korean.fr: French.es: Spanish.it: Italian.de: German.tr: Turkish.ru: Russian.pt: Portuguese (Brazil).pt-PT: Portuguese (Portugal).vi: Vietnamese.id: Indonesian.ms: Malay.th: Thai.ar: Arabic.hi: Hindi.fil: Filipino.Note: Use / to separate multiple languages, such as en/ja, which indicates English and Japanese. |
| ProcessType | No | Integer | Subtitle processing type: - 0: ASR recognition subtitle. - 1: pure subtitle translation. Note: If the field is unspecified, ASR is used by default. |
3. Output Parameters
| Parameter Name | Type | Description |
|---|---|---|
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
4. Example
Example1 Modifying a Smart Subtitle Template
Input Example
POST / HTTP/1.1
Host: mps.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifySmartSubtitleTemplate
<Common request parameters>
{
"Definition": 202281,
"TranslateSwitch": "ON",
"Name": "New name",
"SubtitleType": 1,
"TranslateDstLanguage": "en"
}Output Example
{
"Response": {
"RequestId": "569d5d19-d01c-4efc-97dc-4ea53ae95647"
}
}5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for Node.js
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
Command Line Interface
6. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation.InvalidMpsUser | Operation failed: unauthorized MPS user. |
| InternalError | Internal error. |
| InvalidParameter | Parameter error. |
| InvalidParameterValue.AsrHotWordsLibraryId | The value of the hotword lexicon ID parameter is incorrect. |
| InvalidParameterValue.AsrHotWordsSwitch | The value of the hotword lexicon switch parameter is incorrect. |
| InvalidParameterValue.Comment | Parameter error: template description. |
| InvalidParameterValue.ModifyDefaultTemplate | Incorrect parameter value: the default template cannot be modified. |
| InvalidParameterValue.Name | Incorrect parameter value: Name exceeds the length limit. |
| InvalidParameterValue.SubtitleFormat | Incorrect parameter value: The value of the SubtitleFormat parameter is invalid. |
| InvalidParameterValue.SubtitleType | The value of the subtitle language type is incorrect. |
| InvalidParameterValue.TranslateDstLanguage | The value of the target language parameter is incorrect. |
| InvalidParameterValue.TranslateSwitch | The value of the translation switch parameter is incorrect. |
| InvalidParameterValue.VideoSrcLanguage | The value of the video source language parameter is incorrect. |
| ResourceNotFound.TemplateNotExist | The resource does not exist: the template does not exist. |