tencent cloud

APIs

AddRecordTemplate

Download
Focus Mode
Font Size
Last updated: 2026-10-26 11:49:07

1. API Description

Domain name for API request: iss.intl.tencentcloudapi.com.

Used to add a real-time cloud 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: AddRecordTemplate.
Version Yes String Common Params. The value used for this API: 2023-05-17.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
TemplateName Yes String Template name. It can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-), with a length not exceeding 32 characters. The template name must be globally unique and cannot be empty or duplicated.
TimeSections.N Yes Array of RecordTemplateTimeSections Cloud upload time period. Settings can be done by week. Multiple time periods can be set for each day, with each time period not less than 10 minutes.

3. Output Parameters

Parameter Name Type Description
Data RecordTemplateInfo Returned result
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 Success

Input Example

POST / HTTP/1.1
Host: iss.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddRecordTemplate
<Common request parameters>

{
    "TemplateName": "name",
    "TimeSections": [
        {
            "DayOfWeek": 1,
            "StartTime": "08:00:00",
            "EndTime": "12:00:00"
        },
        {
            "DayOfWeek": 1,
            "StartTime": "20:30:00",
            "EndTime": "23:400:00"
        },
        {
            "DayOfWeek": 2,
            "StartTime": "12:10:00",
            "EndTime": "16:10:00"
        },
        {
            "DayOfWeek": 7,
            "StartTime": "00:00:00",
            "EndTime": "23:59:59"
        }
    ]
}

Output Example

{
    "Response": {
        "Data": {
            "TemplateId": "48676e89a8c**********baa36220fa4",
            "TemplateName": "name",
            "TimeSections": [
                {
                    "DayOfWeek": 1,
                    "StartTime": "08:00:00",
                    "EndTime": "12:00:00"
                },
                {
                    "DayOfWeek": 1,
                    "StartTime": "20:30:00",
                    "EndTime": "23:400:00"
                },
                {
                    "DayOfWeek": 2,
                    "StartTime": "12:10:00",
                    "EndTime": "16:10:00"
                },
                {
                    "DayOfWeek": 7,
                    "StartTime": "00:00:00",
                    "EndTime": "23:59:59"
                }
            ]
        },
        "RequestId": "fba7981b-d6a4-4177-b11d-e53a6110e4cd"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

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 Operation failed
InvalidParameter.InvalidBodyFormat Invalid message body format
InvalidParameter.InvalidTimeSection Invalid time segment
InvalidParameterValue.EmptyName Name cannot be empty
InvalidParameterValue.IllegalName Name contains non-compliant characters (only Chinese, English, digits, _, and - are supported)
InvalidParameterValue.InvalidTimeSectionValue Invalid time segment value
InvalidParameterValue.StartTimeGreaterThanOrEqualEndTime Start time cannot be greater than or equal to end time.
InvalidParameterValue.TimeLessThanTenMinutes Time interval cannot be less than 10 minutes.
InvalidParameterValue.TooLongName Name is too long
MissingParameter.EmptyTimeSection Time segment not found
ResourceInUse.TemplateNameRepeat Template name must be unique.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback