このエンドポイントを使用して、ドメインを追加し、組織と関連づけます。
ドメインについて、少なくとも1つの認証タイプを指定しなければなりません。[認証タイプを取得する] エンドポイントを使用して、利用可能な認証タイプを取得します。
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 メール送信時に使用するメールアドレス DCV 方法用 email にのみ返されます。
|
.. 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 |
テキストファイルのファイル名とウェブサーバー上の配置場所 DCV 方法用 http-token にのみ返されます。
|