Last updated: 2020-08-20 18:05:39

1. API Description

Domain name for API request:

This API is used to bind a custom domain name to a service.
Each service in API Gateway provides a default domain name for users to call. If you want to use your own domain name, you can bind a custom domain name to the target service. After getting the ICP filing and configuring the CNAME record between the custom and default domain names, you can directly call the custom domain name.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example:

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 parameter. The value used for this API: BindSubDomain.
Version Yes String Common parameter. The value used for this API: 2018-08-08.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
ServiceId Yes String Unique service ID.
SubDomain Yes String Custom domain name to be bound.
Protocol Yes String Protocol supported by service. Valid values: http, https, http&https.
NetType Yes String Network type. Valid values: OUTER, INNER.
IsDefaultMapping Yes Boolean Whether the default path mapping is used. The default value is true. If the value is false, the custom path mapping will be used and PathMappingSet will be required in this case.
NetSubDomain Yes String Default domain name.
CertificateId No String Unique certificate ID of the custom domain name to be bound. The certificate can be uploaded if Protocol is https or http&https.
PathMappingSet.N No Array of PathMapping Custom domain name path mapping. It can contain up to 3 Environment values which can be set to only test, prepub, and release, respectively.

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Binding a custom domain name

Input Example
&<Common request parameters>

Output Example

  "Response": {
    "Result": true,
    "RequestId": "6e00553a-8158-4f70-ad43-e1b046af1502"

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.


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.CertificateIdEnterpriseWaitSubmit The enterprise certificate is waiting to be submitted.
FailedOperation.CertificateIdError The certificate does not exist or you do not have permission to view it. Please upload a valid certificate in the SSL Certificates Service Console.
FailedOperation.CertificateIdExpired The certificate has expired.
FailedOperation.CertificateIdInfoError The certificate information is empty. Please submit a ticket for assistance.
FailedOperation.CertificateIdUnderVerify The certificate is under review.
FailedOperation.CertificateIdUnknownError The certificate is in an unknown status. Please submit a ticket for assistance.
FailedOperation.CertificateIdVerifyFail Certificate review failed.
FailedOperation.CertificateIsNull The certificate ID is empty.
FailedOperation.DefineMappingEnvironmentError Environment in the custom path mapping can be set to only test,prepub, orrelease`.
FailedOperation.DefineMappingNotNull The custom path mapping is required.
FailedOperation.DefineMappingParamRepeat The custom path mapping value already exists.
FailedOperation.DefineMappingPathError The Path in the custom path mapping is non-compliant.
FailedOperation.DomainAlreadyBindOtherService The domain name has been bound to another service.
FailedOperation.DomainAlreadyBindService The domain name has already been bound to this service.
FailedOperation.DomainNeedBeian The domain name does not have an ICP filing through Tencent Cloud. Please get the ICP filing before binding the domain name.
FailedOperation.DomainResolveError The custom domain name is not configured with a CNAME record pointing to the default domain name or the configuration has not taken effect yet.
FailedOperation.FormatError The domain name format is incorrect.
FailedOperation.IsDefaultMapping PathMappingSet cannot be entered if the default path mapping is used.
FailedOperation.NetSubDomainError The entered default second-level domain name is incorrect.
FailedOperation.ServiceError Service-related error.
InternalError Internal error.
InternalError.OssException OSS internal error.
InvalidParameter.FormatError Incorrect parameter format.
InvalidParameterValue.InvalidProcotol Invalid protocol type parameter.
LimitExceeded.ExceededDefineMappingLimit You can set up to 3 sets of custom path mappings.
LimitExceeded.ExceededDomainLimit The number of bound domain names exceeds the limit. You can bind up to 5 domain names by default.
ResourceNotFound.InvalidService The corresponding service is invisible.
UnsupportedOperation.InvalidServiceTrade As the service is isolated, the operation is not supported currently.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback