tencent cloud

Feedback

CreateRecordBatch

Last updated: 2023-03-20 11:02:15

1. API Description

Domain name for API request: dnspod.tencentcloudapi.com.

This API is used to bulk add records.

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: CreateRecordBatch.
Version Yes String Common Params. The value used for this API: 2021-03-23.
Region No String Common Params. This parameter is not required for this API.
DomainIdList.N Yes Array of String Domain ID. Separate multiple ones by comma.
RecordList.N Yes Array of AddRecordBatch Record array

3. Output Parameters

Parameter Name Type Description
DetailList Array of CreateRecordBatchDetail Information of the bulk added domains
JobId Integer Bulk task ID
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Bulk adding records

Input Example

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

{
    "DomainIdList": [
        49,
        53
    ],
    "RecordList": [
        {
            "SubDomain": "aa,bb",
            "RecordType": "A",
            "RecordLine": "Default",
            "Value": "11.22.33.44",
            "TTL": 600
        }
    ]
}

Output Example

{
    "Response": {
        "RequestId": "ab4f1426-ea15-42ea-8183-dc1b44151166",
        "DetailList": [
            {
                "RecordList": [
                    {
                        "RecordLine": "Default",
                        "TTL": "600",
                        "Id": 0,
                        "SubDomain": "www",
                        "RecordType": "A",
                        "Value": "1.2.3.4",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    },
                    {
                        "RecordLine": "Default",
                        "TTL": "600",
                        "Id": 1,
                        "SubDomain": "wap",
                        "RecordType": "A",
                        "Value": "1.2.3.4",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    },
                    {
                        "RecordLine": "Default",
                        "TTL": "600",
                        "Id": 2,
                        "SubDomain": "bbs",
                        "RecordType": "A",
                        "Value": "1.2.3.4",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    }
                ],
                "Id": 0,
                "DomainId": 48,
                "Domain": "dnsapi6.cn",
                "DomainGrade": "DP_PLUS",
                "ErrMsg": null,
                "Status": "waiting",
                "Operation": null
            },
            {
                "RecordList": [
                    {
                        "RecordLine": "Default",
                        "TTL": "600",
                        "Id": 0,
                        "SubDomain": "www",
                        "RecordType": "A",
                        "Value": "1.2.3.4",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    },
                    {
                        "RecordLine": "Default",
                        "TTL": "600",
                        "Id": 1,
                        "SubDomain": "wap",
                        "RecordType": "A",
                        "Value": "1.2.3.4",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    },
                    {
                        "RecordLine": "Default",
                        "TTL": "600",
                        "Id": 2,
                        "SubDomain": "bbs",
                        "RecordType": "A",
                        "Value": "1.2.3.4",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    }
                ],
                "Id": 1,
                "DomainId": 49,
                "Domain": "dnsapi1.cn",
                "DomainGrade": "DP_FREE",
                "ErrMsg": null,
                "Status": "waiting",
                "Operation": null
            }
        ],
        "JobId": 34
    }
}

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.DomainIsLocked You cannot perform this operation on a locked domain.
FailedOperation.DomainIsSpam You cannot perform this operation on a banned domain.
InvalidParameter.BatchRecordCreateActionError Failed to bulk create records. Cause: Internal error.
InvalidParameter.BatchTaskCountLimit The number of tasks exceeds the upper limit.
InvalidParameter.DomainIdInvalid The domain number is incorrect.
InvalidParameter.DomainInvalid The domain is incorrect. Enter a top-level domain such as dnspod.cn.
InvalidParameter.DomainIsAliaser This domain is an alias of another domain.
InvalidParameter.DomainsEmpty No domains have been submitted.
InvalidParameter.JobGreaterThanLimit The number of tasks exceeds the upper limit.
InvalidParameter.ParamsIllegal The parameter is invalid, so the request was rejected.
InvalidParameter.RecordValueInvalid The record value is incorrect.
InvalidParameter.RecordValueLengthInvalid The DNS record value is too long.
InvalidParameter.RecordsEmpty No records have been submitted.
InvalidParameterValue.DomainNotExists The current domain is incorrect. Return to the previous step and try again.
OperationDenied.IPInBlacklistNotAllowed Sorry, you cannot add a blocked IP.
RequestLimitExceeded.BatchTaskLimit Too many tasks have been added for your IP. Try again later.
RequestLimitExceeded.CreateDomainLimit A great number of domains have been added under your account in a short period of time. Control the frequency of adding domains.
RequestLimitExceeded.RequestLimitExceeded The number of API requests exceeds the limit.