使用此端点为域设置域控制验证 (DCV) 方法。
curl -X PUT \
'https://www.digicert.com/services/v2/domain/{{domain_id}}/dcv/method' \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"dcv_method": "<dcv_method>"
}'
import requests
url = "https://www.digicert.com/services/v2/domain/{{domain_id}}/dcv/method"
payload = "{\n\t\"dcv_method\": \"<dcv_method>\"\n}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/json"
}
response = requests.request("PUT", url, data=payload, headers=headers)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v2/domain/{{domain_id}}/dcv/method"
payload := strings.NewReader("{\n\t\"dcv_method\": \"<dcv_method>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var request = require("request");
var options = { method: 'PUT',
url: 'https://www.digicert.com/services/v2/domain/{{domain_id}}/dcv/method',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body: { dcv_method: '<dcv_method>' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{}
{
"dcv_token": {
"token": "<random_value>",
"status": "pending",
"expiration_date": "2018-11-18T20:35:32+00:00",
"verification_value": "dcv.digicert.com"
}
}
{
"dcv_token": {
"token": "<random_value>",
"status": "pending",
"expiration_date": "2018-11-18T20:38:45+00:00",
"http_token_url": "http://example.com/.well-known/pki-validation/<random_file_name>.txt"
}
}
{
"dcv_token": {
"token": "<random_value>",
"status": "pending",
"expiration_date": "2018-11-18T20:40:43+00:00"
}
}
名称 | 请求/选项 | 类型 | 描述 |
---|---|---|---|
dcv_method | 必填 | string |
选择要对域使用的 DCV 方法。 请参阅词汇表 - DCV 方法 |
名称 | 类型 | 描述 |
---|---|---|
dcv_token | string | 包含 DCV 方法更改信息的对象。 |
.. token | string | 用于证明对域的控制权的随机值。 |
.. status | string | 域验证的状态。 |
.. expiration_date | string |
DCV 令牌过期的时间戳。 格式:UTC 时区和 ISO 8601 日期 |
.. verification_value | string |
DNS 记录目标主机字段的值。 仅当 DCV 方法是 dns-cname-token 时返回。
|
.. http_token_url | string |
.txt 文件的文件名和位置。 仅当 DCV 方法是 http-token 时返回。
|