使用此端點新增網域,並將此網域和組織關聯。
您必須指定至少一個驗證類型給網域。使用取得驗證類型端點取得可用的驗證類型。
curl -X POST \
https://www.digicert.com/services/v2/domain \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"name": "example.com",
"organization": {
"id": 112233
},
"validations": [
{
"type": "ov"
},
{
"type": "ev"
}
],
"dcv_method": "email"
}'
import requests
url = "https://www.digicert.com/services/v2/domain"
payload = "{\n \"name\": \"example.com\",\n \"organization\": {\n \"id\": 112233\n },\n \"validations\": [\n {\n \"type\": \"ov\"\n },\n {\n \t\"type\": \"ev\"\n }\n ],\n \"dcv_method\": \"email\"\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"
payload := strings.NewReader("{\n \"name\": \"example.com\",\n \"organization\": {\n \"id\": 112233\n },\n \"validations\": [\n {\n \"type\": \"ov\"\n },\n {\n \t\"type\": \"ev\"\n }\n ],\n \"dcv_method\": \"email\"\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',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body:
{ name: 'example.com',
organization: { id: 112233 },
validations: [ { type: 'ov' }, { type: 'ev' } ],
dcv_method: 'email' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"id": 123356,
"validation_emails": {
"name_scope": "example.com",
"base_emails": [
"postmaster@example.com",
"administrator@example.com",
"hostmaster@example.com",
"admin@example.com",
"webmaster@example.com"
],
"whois_emails": [
"it@example.com"
]
}
}
{
"id": 123356,
"dcv_token": {
"token": "{{random_token}}",
"status": "pending",
"expiration_date": "2019-03-02T17:21:39+00:00"
}
}
{
"id": 123356,
"dcv_token": {
"token": "{{random_token}}",
"status": "pending",
"expiration_date": "2019-03-02T17:22:05+00:00",
"verification_value": "dcv.digicert.com"
}
}
{
"id": 671903,
"dcv_token": {
"token": "{{random_token}}",
"status": "pending",
"expiration_date": "2019-03-02T17:22:48+00:00",
"http_token_url": "http://example.com/.well-known/pki-validation/{{random_filename}}.txt"
}
}
名稱 | 必填/選填 | 類型 | 說明 |
---|---|---|---|
name | 必填 | string | 要提交的網域名稱 |
organization | 必填 | object | 網域的組織。 |
.. id | 必填 | int | 組織 ID。 |
validations | 必填 | array | 組織的驗證類型的清單。 |
.. type | 必填 | string |
驗證類型識別碼。 請參閱詞彙 — 驗證類型 |
dcv_method | 選填 | string |
要使用的網域控制驗證方法。 請參閱詞彙 — 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 日期 |
.. http_token_url | string |
文字檔案的檔案名稱和應放置在網頁伺服器上的位置。 僅為 http-token DCV 方法傳回。
|