tencent cloud

Feedback

CreateDomainBatch

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 domains.

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: CreateDomainBatch.
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.
DomainList.N Yes Array of String Domain array
RecordValue No String Add A records of @ and www for each domain with the record value of the IP. If this parameter is not passed in or is set to an empty string or null, only the domain but not the records will be added.

3. Output Parameters

Parameter Name Type Description
DetailList Array of CreateDomainBatchDetail 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 domains

This example shows you how to bulk add domains.

Input Example

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

{
    "DomainList": [
        "tencent1.com",
        "tencent2.com"
    ],
    "RecordValue": "11.22.33.44"
}

Output Example

{
    "Response": {
        "RequestId": "ab4f1426-ea15-42ea-8183-dc1b44151166",
        "DetailList": [
            {
                "RecordList": [
                    {
                        "RecordLine": "Default",
                        "TTL": 600,
                        "Id": 0,
                        "SubDomain": "test",
                        "RecordType": "A",
                        "Value": "11.22.33.45",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    },
                    {
                        "RecordLine": "Default",
                        "TTL": 600,
                        "Id": 1,
                        "SubDomain": "@",
                        "RecordType": "A",
                        "Value": "11.22.33.45",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    }
                ],
                "Id": 0,
                "Domain": "tencent12.com",
                "DomainGrade": "DP_FREE",
                "ErrMsg": null,
                "Status": "waiting",
                "Operation": "plus"
            },
            {
                "RecordList": [
                    {
                        "RecordLine": "Default",
                        "TTL": 600,
                        "Id": 0,
                        "SubDomain": "test",
                        "RecordType": "A",
                        "Value": "11.22.33.45",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    },
                    {
                        "RecordLine": "Default",
                        "TTL": 600,
                        "Id": 1,
                        "SubDomain": "@",
                        "RecordType": "A",
                        "Value": "11.22.33.45",
                        "ErrMsg": null,
                        "Status": "waiting",
                        "Operation": "plus"
                    }
                ],
                "Id": 1,
                "Domain": "tencent13.com",
                "DomainGrade": "DP_FREE",
                "ErrMsg": null,
                "Status": "waiting",
                "Operation": "plus"
            }
        ],
        "JobId": 30
    }
}

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 The operation failed.
FailedOperation.DomainIsLocked You cannot perform this operation on a locked domain.
FailedOperation.DomainIsSpam You cannot perform this operation on a banned domain.
InvalidParameter.BatchDomainCreateActionError Failed to bulk create domains. 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.RecordValueInvalid The record value is incorrect.
InvalidParameter.RecordValueLengthInvalid The DNS record value is too long.
InvalidParameter.TooManyInvalidDomains The current account has too many invalid domains and is unable to use this feature. Point the DNS server of existing domains to DNSPod correctly and try adding them.
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.