列出 DCV 方法

GET
https://www.digicert.com/services/v2/domain/dcv/method

使用此端点列出对域可用的域控制验证 (DCV) 方法。

cURL
curl -X GET \
  https://www.digicert.com/services/v2/domain/dcv/method \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v2/domain/dcv/method"

headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/domain/dcv/method"

	req, _ := http.NewRequest("GET", url, nil)

	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))

}
NodeJS
var request = require("request");

var options = { method: 'GET',
  url: 'https://www.digicert.com/services/v2/domain/dcv/method',
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
200 OK
{
    "methods": [
        {
            "name": "email",
            "display_name": "Verification Email",
            "description": "This method sends a verification link and token via email",
            "default": true
        },
        {
            "name": "dns-cname-token",
            "display_name": "DNS CNAME Record",
            "description": "This method lets you add a CNAME record from your domain registrar's control panel",
            "default": false
        },
        {
            "name": "http-token",
            "display_name": "HTTP Practical Demonstration",
            "description": "This method lets you add a token value to a specific URL on the domain being validated",
            "default": false
        },
        {
            "name": "dns-txt-token",
            "display_name": "DNS TXT Record",
            "description": "This method lets you add a TXT record from your domain registrar's control panel",
            "default": false
        }
    ]
}

响应参数

名称 类型 描述
methods array 可用 DCV 方法的列表。
.. name string DCV 方法标识符。
.. display_name string DCV 方法的完全显示名称。
.. description string DCV 方法的描述。
.. default bool DCV 方法是否为帐户的默认设置。