使用此端点提交要进行指定验证类型验证的域。
包括可选的 dcv_method
参数,以指定在证明对域的控制权时所使用的 DCV 方法。
curl -X POST \
'https://www.digicert.com/services/v2/domain/{{domain_id}}/validation' \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"validations": [
{
"type": "ov"
},
{
"type": "ev"
}
]
}'
import requests
url = "https://www.digicert.com/services/v2/domain/{{domain_id}}/validation"
payload = "{\n\t\"validations\": [\n\t\t\t{\n\t\t\t\t\"type\": \"ov\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"ev\"\n\t\t\t}\n\t\t]\n}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/json"
}
response = requests.request("POST", 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}}/validation"
payload := strings.NewReader("{\n\t\"validations\": [\n\t\t\t{\n\t\t\t\t\"type\": \"ov\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"ev\"\n\t\t\t}\n\t\t]\n}")
req, _ := http.NewRequest("POST", 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: 'POST',
url: 'https://www.digicert.com/services/v2/domain/{{domain_id}}/validation',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body: { validations: [ { type: 'ov' }, { type: 'ev' } ] },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
// empty
{
"id": 112233,
"validation_emails": {
"name_scope": "example.com",
"base_emails": [
"administrator@example.com",
"postmaster@example.com",
"admin@example.com",
"webmaster@example.com",
"hostmaster@example.com"
]
}
}
{
"id": 112233,
"dcv_token": {
"token": "{{random_value}}",
"expiration_date": "2020-02-21T06:29:24+00:00"
}
}
{
"id": 112233,
"dcv_token": {
"token": "{{random_value}}",
"expiration_date": "2020-02-21T07:01:29+00:00",
"verification_value": "dcv.digicert.com"
}
}
{
"id": 112233,
"dcv_token": {
"token": "{{random_value}}",
"expiration_date": "2020-02-21T07:01:29+00:00",
"http_token_url": "http://example.com/.well-known/pki-validation/fileauth.txt"
}
}
名称 | 请求/选项 | 类型 | 描述 |
---|---|---|---|
validations | 必填 | array | 要提交域进行验证的验证类型的列表。 |
.. type | 必填 | string |
验证类型标识符。 请参阅词汇表 - 验证类型 |
dcv_method | 可选 | string |
选择要对域使用的 DCV 方法。 请参阅词汇表 - DCV 方法 |
名称 | 类型 | 描述 |
---|---|---|
id | int | 所添加域的 ID。 |
validation_emails | object |
发送 DCV 电子邮件时使用的电子邮件地址。 仅对 email DCV 方法返回。
|
.. name_scope | string | 用于 WHOIS 记录和构造的电子邮件地址的域范围。 |
.. base_emails | array | 构造的电子邮件地址的列表。 |
.. whois_emails | array | WHOIS 记录上的电子邮件地址的列表。 |
dcv_token | object |
DCV 令牌详细信息。 仅对 dns-txt-token ,dns-cname-token ,和 http-token DCV 方法返回。
|
.. token | string | 要用于 DCV 验证的随机值。 |
.. status | string |
DCV 状态。 可能的值: pending ,active
|
.. expiration_date | string |
令牌过期的时间戳。 格式:UTC 时区和 ISO 8601 日期 |
.. verification_value | string |
CNAME 记录的主机字段(或同等字段)的值。 仅对 dns-cname-token DCV 方法返回。
|
.. http_token_url | string |
文本文件的文件名以及在 Web 服务器上的放置位置。 仅对 http-token DCV 方法返回。
|