--- title: "DV SSL: Generate DCV token" source_url: https://dev.digicert.com/certcentral-apis/services-api/orders/dv-ssl-generate-dcv-token.html api_method: PUT api_endpoint: "/services/v2/order/certificate/{{order_id}}/dcv-random-value" api_url: "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/dcv-random-value" --- **PUT** `https://www.digicert.com/services/v2/order/certificate/{{order_id}}/dcv-random-value` Use this endpoint to request the domain control validation (DCV) random value for a DV, OV, or EV TLS certificate order using a DCV method of `dns-txt-token`, `dns-cname-token`, or `http-token`. This value is required to prove domain ownership before the certificate can be issued. If a valid order random value already exists, DigiCert returns the existing random value instead of generating a new one. If the existing order random value is expired, DigiCert generates a new random value and returns it in the API response. Use the order random value to complete the DCV check for any domains submitted for validation with the order. DCV random value has an expiration date, which is provided in the API response ("expiration_date": "YYYY-MM-DDTHH:MM:SSZ"). Ensure that domain validation is completed before this date to avoid validation failures. ## Example requests and responses **cURL** ```bash curl -X PUT \ 'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/dcv-random-value' \ -H 'Content-Type: application/json' \ -H 'X-DC-DEVKEY: {{api_key}}' ``` **Python** ```python import requests url = "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/dcv-random-value" payload = "" headers = { 'X-DC-DEVKEY': "{{api_key}}", 'Content-Type': "application/json" } response = requests.request("PUT", url, data=payload, headers=headers) print(response.text) ``` **Go** ```go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/dcv-random-value" req, _ := http.NewRequest("PUT", 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** ```javascript var request = require("request"); var options = { method: 'PUT', url: 'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/dcv-random-value', 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 ```json { "dcv_random_value": "fjqr7th5ds", "expiration_date": "2023-02-24T16:25:52+00:00" } ``` ## Response parameters
| Name | Type | Description |
|---|---|---|
| dcv_random_value | string | Random value used to complete DCV. For DNS CNAME validation, this value is used to construct the CNAME record target. |
| expiration_date | string | Date and time the random value expires. UTC timezone, ISO 8601 format. |