ApplyFreeCertificate
1. API Description
Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to apply for a free certificate. If you need to proceed with DNS delegated verification or file verification, you can call this API to initiate the certificate application and obtain the corresponding verification content based on the application method. The order for API calls is as follows:.
Step 1: Call ApplyFreeCertificate, specify the verification method for free certificate application, and obtain the verification content.
Step 2: Configure the corresponding domain as verification content.
Step 3: Call CheckFreeCertificateVerification to verify. After verification passes, the free certificate application is completed.
Step 4: Call ModifyHostsCertificate to issue a domain certificate configured to use the EdgeOne free certificate.
The application method introduction in the document: Free Certificate Application Description.
description:.
- Only CNAME access mode can call this API to specify the free certificate application method. NS/DNSPod hosting access modes use automatic validation to apply for free certificates with no need to call this API.
- If you need to switch the free certificate authentication method, you can call this API again by changing the VerificationMethod field to update it.
- A domain name can only apply for one free certificate. After calling this API, the backend will trigger the free certificate application task. You need to complete the domain name verification info configuration within 2 days, then finish certificate authentication.
A maximum of 20 requests can be initiated per second for this API.
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: ApplyFreeCertificate. |
| Version | Yes | String | Common Params. The value used for this API: 2022-09-01. |
| Region | No | String | Common Params. This parameter is not required. |
| ZoneId | Yes | String | Site ID. |
| Domain | Yes | String | Specifies the target domain name for free certificate application. |
| VerificationMethod | Yes | String | Specifies the verification method for applying for a free certificate. for detailed verification methods, refer to the free certificate application documentation. valid values:. Note: after triggering this api, you need to complete the verification content configuration based on the returned verification information. once configured, you must also verify by calling the check free certificate application result api. after verification passes, the application succeeds. once the application is successful, you can call the configure domain name certificate API to deploy a free certificate for the current domain name. |
3. Output Parameters
| Parameter Name | Type | Description |
|---|---|---|
| DnsVerification | DnsVerification | Specifies the verification information for free certificate application when VerificationMethod is dns_challenge. |
| FileVerification | FileVerification | Specifies the verification information related to the free certificate application for the domain name when VerificationMethod is http_challenge. |
| 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 Applying for Free Certificate Using HTTP Access File Validation Mode
This example shows you how to apply for a free certificate using file validation mode with HTTP access for the domain name (abc.test.com) under the site (ZoneId is zone-2fgd17m17xw).
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ApplyFreeCertificate
<Common request parameters>
{
"ZoneId": "zone-2fgd17m17xw",
"Domain": "abc.test.com",
"VerificationMethod": "http_challenge"
}Output Example
{
"Response": {
"RequestId": "064a8c04-2d3e-4c9d-9473-39a8f76276ea",
"FileVerification": {
"Content": "9i8vhsvt9y8y3sx1s2d",
"Path": "/.well-known/teo-verification/yvnu7sesms"
}
}
}Example2 Applying for a Free Certificate Using DNS Delegation Verification Method
This example shows you how to apply for a free certificate using the DNS delegated verification method for the domain name (qwe.test.com) under the site (ZoneId is zone-2fgd17m17xw).
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ApplyFreeCertificate
<Common request parameters>
{
"ZoneId": "zone-2fgd17m17xw",
"Domain": "qwe.test.com",
"VerificationMethod": "dns_challenge"
}Output Example
{
"Response": {
"RequestId": "064a8c04-2d3e-4c9d-9473-39a8f76276ea",
"DnsVerification": {
"RecordType": "CNAME",
"RecordValue": "_acme-challenge",
"Subdomain": "www.example.com.edgeone.com"
}
}
}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
There is no error code related to the API business logic. For other error codes, please see Common Error Codes.